whitenoise-spa
Serve SPA (Single Page Application) in django using whitenoise
Installation
You can install the package via pip:
pip install whitenoise-spa
Usage
- Edit your
settings.pyfile and addwhitenoise_spa.middleware.WhiteNoiseSPAMiddlewareto the MIDDLEWARE list. The middleware should be placed directly after the Django SecurityMiddleware (if you are using it) and before all other middleware. This middleware replaces the whitenoise middleware.MIDDLEWARE = [ # ... "django.middleware.security.SecurityMiddleware", "whitenoise_spa.middleware.WhiteNoiseSPAMiddleware", # ... ]
- Configure SPA root and urls.
WHITENOISE_SPA_ROOT = BASE_DIR / "dist" WHITENOISE_SPA_URL_PATTERN = "/|/login/|/settings/"
License
This project is licensed under the terms of the MIT license.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
whitenoise_spa-2.0.0.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file whitenoise_spa-2.0.0.tar.gz.
File metadata
- Download URL: whitenoise_spa-2.0.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9143494b5932a963f37075652f0e22e0891a13d17f174038fe444add4263b0c1
|
|
| MD5 |
d6cd3f29a5aa5f911cc483d071f820b9
|
|
| BLAKE2b-256 |
ac0f6a461a36a0c6fde5cbfc0149516acf2c8afac9ea8a57bdd91ff49cbd79f5
|
File details
Details for the file whitenoise_spa-2.0.0-py3-none-any.whl.
File metadata
- Download URL: whitenoise_spa-2.0.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/5.1.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8004e40473734cd6ecf7d62068fe5006202981978307fe7cf254fda2383ab977
|
|
| MD5 |
543ecfb211962506275faa7a3d69509b
|
|
| BLAKE2b-256 |
c05844e9fb565dadb2717bffd06b104d094919f7176ef75dffd6586c39c791c4
|