- Provide middleware;
- If user is anonymous, look for file in BUILD_DIR
- If it exists, return it immediately
- If it doesn't exist, call the view
- If it doesn't exist and it returns a 2xx, write it to the builder
- If it doesn't exist and it returns a 3xx, write the 30x.html template to the builder, pointing at the redirect endpoint
- If it doesn't exist and it returns a 404, write the 404.html to the builder
- If the user is not anonymous, render the original view, including other middlewares etc.
- Middleware has an inclusions regex -- see django-moreloaders for regex ideas.
- If user is anonymous, look for file in BUILD_DIR
- Provide builders;
- Attachable to a view or a model
- Builders use one of the staticfiles storage engines
- See implementation of django-bakery and django-medusa for useful ideas.
- Builders are attached like so: `class MyView(View): builder = StorageBuilder(storage=??)
- Builders fall back to a default storage
- writing the files should try and follow the django-medusa/bakery pathing format (which I think is just index.html if ends with /)
- Provide management commands;
- for doing a build of all urlconf views which have a builder
- If possible, provide stdout output for putting passthroughs in into Apache/NGINX??
Last active
January 2, 2016 09:29
-
-
Save kezabelle/8283005 to your computer and use it in GitHub Desktop.
Implement a semistatic handler app for Django?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment