يولد Django Freeze النسخة الثابتة من موقع Django الخاص بك.
فقط قم بتشغيل python manage.py generate_static_site :)
pip install django-freezefreeze إلى settings.INSTALLED_APPSsites (التعليمات هنا) كل هذه الإعدادات اختيارية ، إن لم يتم تعريفها في 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' } أضف freeze.urls إلى urls.py إذا كنت تريد أن يتمكن Superusers والموظفين من استخدام عناوين URL للتجميد.
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 " صدر تحت رخصة معهد ماساتشوستس للتكنولوجيا.
django-admin-interface واجهة المسؤول الافتراضية التي تم تخصيصها من قبل المسؤول نفسه. Windows المنبثقة التي تم استبدالها بواسطة وسيط. ؟ ⚡
django-cache-cleaner قم بمسح ذاكرة التخزين المؤقت بالكامل أو ذاكرة التخزين المؤقت الفردية بسهولة باستخدام لوحة المسؤول أو أمر الإدارة. ؟
django-colorfield حقل ألوان بسيط للموديلات مع مراكز ألوان لطيفة في المشرف. ؟
django-extra-settings تكوين وإدارة إعدادات إضافية مكتوبة باستخدام مسؤول Django فقط.
django-maintenance-mode يعرض صفحة خطأ 503 عند تشغيل وضع الصيانة. ؟
django-redirects - إعادة توجيه مع التحكم الكامل. ↪
django-treenode - ربما أفضل طراز / مسؤول تجريدي لأشياءك القائمة على الأشجار. ؟
python-benedict الفئة الفرعية DICT مع دعم القائمة الرئيسية/Keypath ، اختصارات I/O (BASE64 ، CSV ، JSON ، PEACLE ، PLIST ، BLIST ، QUERY-BRY ، TOML ، XML ، YAML) والعديد من الأدوات المساعدة.
python-codicefiscale - تشفير/فك شفرة الرموز المالية الإيطالية - Codifica/decodifica del codice fiscale. ؟ ؟
python-fontbro - عمليات الخطوط الودية. ؟
python-fsutil مرافق نظام الملفات للديفات الكسول. ؟