Metadata-Version: 2.1
Name: django-sam
Version: 0.0.1
Summary: Basic Static Asset Middleware for Django
Home-page: https://github.com/GlobalRadio/django-sam
Author: Chris Graham
Author-email: chris.graham@global.com
License: MIT
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django >=3.2.0

# 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.
