Skip to content

dozymoe/frozen-django

Repository files navigation

FROZEN DJANGO

Export webpages created by your Django views into html files.

It is dumb, it won't deploy the files to AWS for instance, and won't collect assets from static files or media files.

The assumption is that the build process will be triggered by Django signals, for example when a BlogPost was created, and will only rebuild the related html (or json) files.

Inspired by:

Requirements

  • add frozen_django to your INSTALLED_APPS
  • will only process urls with file extensions (.html, .json, .js, .xml, etc.)
  • Django Views with pagination must have Link HTTP header or html tag <link rel="next" /> in their content

Settings

  • FROZEN_ROOT (should be filled, can be dict for multisite, keys are items in ALLOWED_HOSTS)
  • FROZEN_MIDDLEWARE (optional)

API

  • Django Command freeze_view
  • frozen_django.tasks_celery.freeze_view
  • frozen_django.tasks_uwsgi.freeze_view

Examples

Here is an example of all pages rebuild:

File blog/settings.py

File blog/urls.py:

File blog_post/urls.py:

File blog_post/signals.py

File blog_post/apps.py

File website/views.py

File website/tasks.py

File website/templates/website/home.html

About

Incrementally create static sites from Django, meant to be used in background tasks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages