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.static_admin_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.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be84458c2fb33d313a36b45153c7ff55907f1267ed1bc6e6bd37b013194092a0 |
|
MD5 | a401b4a1262e5970471262f420acaf2d |
|
BLAKE2b-256 | f6cfad39872870ea0a5613d17aeadc33168936d28a0f4152010ac722662d17b1 |