Django-Freeze는 Django 사이트의 정적 버전을 생성합니다.
python manage.py generate_static_site 실행합니다. :)
pip install django-freeze 실행하십시오settings.INSTALLED_APPS 에 freeze 추가하십시오sites 프레임 워크 활성화 (여기서 지침) 이러한 모든 설정은 settings.py 에서 정의되지 않은 경우 선택 사항입니다.
#the absolute path where to store the .zip and the html files
#default value is a folder named 'freeze' located as sibling of 'settings.MEDIA_ROOT'
FREEZE_ROOT = '/...'
#tells 'freeze' if the urls should be fetched using https instead of http protocol (only if FREEZE_SITE_URL is not defined)
FREEZE_USE_HTTPS = False
#the site-url to crawl, if not specified it will be autodetected using the sites app
FREEZE_SITE_URL = 'http://mydomain.com'
#the base-url for all links relative to root '/'
#useful if the generated static site will run in a specific folder which is not the document-root
FREEZE_BASE_URL = None
#if True 'freeze' will convert all absolute urls to relative urls
#useful if the generated static site will run locally (file://) or in an unknown folder which is not the document-root (only if FREEZE_BASE_URL is not defined)
FREEZE_RELATIVE_URLS = False
#if True 'freeze' will inject a script at the end of each page
#which will force hrefs like 'path/' to 'path/index.html' (only if the site is running under file://)
#useful if the generated static site will run locally (requires FREEZE_RELATIVE_URLS set to True) to prevent local directory index
FREEZE_LOCAL_URLS = False
#if True 'freeze' will fetch each url founded in sitemap.xml
FREEZE_FOLLOW_SITEMAP_URLS = True
#if True 'freeze' will follow and fetch recursively each link-url founded in each page
FREEZE_FOLLOW_HTML_URLS = True
#if true 'freeze' will send an email to managers containing the list of all invalid urls (404, 500, etc..)
FREEZE_REPORT_INVALID_URLS = False
#the invalid urls email report subject
FREEZE_REPORT_INVALID_URLS_SUBJECT = '[freeze] invalid urls'
#if True the generated site will contain also the MEDIA folder and ALL its content
FREEZE_INCLUDE_MEDIA = True
#elif the value is a list or tuple only the specified directories will be included
FREEZE_INCLUDE_MEDIA = ( 'cache' , 'images' , 'videos' , )
#if True the generated site will contain also the STATIC folder and ALL its content
FREEZE_INCLUDE_STATIC = True
#elif the value is a list or tuple only the specified directories will be included
FREEZE_INCLUDE_STATIC = ( 'myapp1' , 'myapp2' , 'myapp3' , )
#if True the generated site will be zipped, the *.zip file will be created in FREEZE_ROOT
FREEZE_ZIP_ALL = False
#the name of the zip file created
FREEZE_ZIP_NAME = 'freeze'
#The request headers to use during the get requests that scrape the site
#can be used to set Authentication headers, by default sets the user-agent
FREEZE_REQUEST_HEADERS = { 'user-agent' : 'django-freeze' } 슈퍼 사용자와 직원이 동결 URL을 사용할 수 있으려면 freeze.urls를 urls.py 에 추가하십시오.
urlpatterns = patterns ( '' ,
...
url ( r'^freeze/' , include ( 'freeze.urls' )),
...
) python manage.py generate_static_site 실행하십시오
슈퍼 사용자와 직원은 다음 URL을 사용하여 생성 된 정적 사이트가 포함 된 .zip을 다운로드하거나 정적 웹 사이트 만 생성 할 수 있습니다.
/freeze/download-static-site/
/freeze/generate-static-site/
(정적 사이트를 생성하는 데 필요한 시간은 프로젝트의 크기에 따라 다릅니다)
sitemap.xml 및 robots.txt 를 추가하십시오 # clone repository
git clone https://github.com/fabiocaccamo/django-extra-settings.git && cd django-extra-settings
# create virtualenv and activate it
python -m venv venv && . venv/bin/activate
# upgrade pip
python -m pip install --upgrade pip
# install requirements
pip install -r requirements.txt -r requirements-test.txt
# install pre-commit to run formatters and linters
pre-commit install --install-hooks
# run tests
tox
# or
python runtests.py
# or
python -m django test --settings " tests.settings " MIT 라이센스에 따라 릴리스.
django-admin-interface 기본 관리자 인터페이스는 관리자 자체가 사용자 정의 할 수 있습니다. 팝업 창이 모달로 대체되었습니다. ? ⚡
django-cache-cleaner 관리자 패널 또는 관리 명령을 사용하여 전체 캐시 또는 개별 캐시를 쉽게 지우십시오. ?
django-colorfield 관리자에 멋진 색상을 가진 모델을위한 간단한 컬러 필드. ?
django-extra-settings Django 관리자 만 사용하여 유형 된 추가 설정을 구성하고 관리합니다.
django-maintenance-mode 유지 보수 모드가 켜져있을 때 503 오류 페이지가 표시됩니다. ?
django-redirects 전체 제어로 리디렉션. ↪️
django-treenode 아마도 나무 기반 물건을위한 최고의 추상 모델 / 관리자 일 것입니다. ?
python-benedict -Keylist/Kyypath Support, I/O 바로 가기 (Base64, CSV, JSON, Pickle, Plist, Query-String, Toml, XML, Yaml) 및 많은 유틸리티를 갖춘 DICT 서브 클래스.
python-codicefiscale -Encode/Decode Italian Fiscal Codes -Codifica/Decodifica del Codice Fiscale. ?? ?
python-fontbro 친숙한 글꼴 작업. ?
python-fsutil 게으른 개발자를위한 파일 시스템 유틸리티. ? ♂️