Basic Static Asset Middleware for Django
Project description
Django SAM
A basic sync/async static asset middleware for Django.
Designed to allow simple running of a purely admin Django instance under Daphne without having to worry about hosting admin static assets.
Installation
Install using pip
:
pip install django-sam
Add django_sam
to Django installed apps in settings.
Add django_sam.middleware
to your MIDDLEWARE
setting, just after django.middleware.security.SecurityMiddleware
Ensure that Django is configured for static assets generation and that the STATIC_ROOT
and STATIC_URL
settings are set.
Ensure that static assets have been generated using python manage.py collectstatic
.
Serve using Daphne (or the development server while developing).
Caveats
This middleware is deliberately very basic and hasn't been tested for static asset hosting beyond those generated by the Django admin. While it may well work for larger static file projects it is recommended that normal CDN-based static file hosting be used in those cases.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_sam-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c5e4e964d8577a4730b62de5e6a3428766497e13c7ef5d9c928fa0dfc860d3a |
|
MD5 | 9b904df4b7fdebc63082d8ef6826931a |
|
BLAKE2b-256 | 09e4ed41471832a1f5d63ea33d4ba719c03eb3042d5acaf034193b03d5c26dec |