Skip to main content

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.

Metadata

Release files for django-sam 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-sam 0.0.2
File Size Uploaded
django_sam-0.0.2.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-sam 0.0.2
File Interpreter ABI Platform
django_sam-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.4 kB

Release files / django_sam-0.0.2.tar.gz

Download URL django_sam-0.0.2.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8b8d5ac4dd5195a791bc46bf64ac10b7f86a03338459fe389b2337b77348dc04
BLAKE2b-256 checksum
How to use checksums
30ff4750ed9b039409bce0410b434d6023a7881c9a02682d1edce3e25d1194ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / django_sam-0.0.2-py3-none-any.whl

Download URL django_sam-0.0.2-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be84458c2fb33d313a36b45153c7ff55907f1267ed1bc6e6bd37b013194092a0
BLAKE2b-256 checksum
How to use checksums
f6cfad39872870ea0a5613d17aeadc33168936d28a0f4152010ac722662d17b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page