This project has been archived by its maintainers, and is no longer receiving any updates.
djspa
Django addon for a single page application with dynamically loaded pages
Installation
Use the python package manager pip to install djutils.
pip install djspa
Usage
Add 'djspa' to INSTALLED_APPS at the end
INSTALLED_APPS = [
...
'djspa',
]
Mark your BasePage (Template Class from that all other templates inherit) with the @set_baseview decorator of djspa
from django.views import generic
from djspa import set_baseview
@set_baseview
class BaseView(generic.TemplateView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['my_global_template_variable'] = 42
return context
Define your dynamic pages by a class, which inherits from your BaseView and the PageMixin.
You have to set at least the name property, which is the name of the template and also the url.
Import the djspa urlpatterns after you defined all views
from djspa.urls import urlpatterns # pylint:disable=C0411; urlpatterns of djspa MUST be loaded after all view definitions
You have to define at least the index page, otherwise you get an endless redirect loop.
from djspa import PageMixin
class Index(BaseView, PageMixin):
name = 'index'
Include the pages snippet in your index page template
{% include 'djspa_pages.html' %}
License
GNU GPLv3, see LICENSE
Maintainer
This package is maintained by Manuel Stingl. For more information see https://opensource.voltane.eu
Metadata
Release files for djspa 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| djspa-1.0.1.tar.gz | 24.0 kB | Without provenance | Details for djspa-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| djspa-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for djspa-1.0.1-py3-none-any.whl |
Total release size: 47.9 kB
Release files / djspa-1.0.1.tar.gz
| Download URL | djspa-1.0.1.tar.gz |
|---|---|
| Size | 24.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f18a3713605106b4ed615969d34c89703d3e65273fdba01104358c62e5b3e068
|
|
BLAKE2b-256 checksum How to use checksums |
a68d4bd1ff3eb96ac6a69e936f40dc0521fd8ee39a08aba4ebd2cc8b89ea33d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.3
|
Release files / djspa-1.0.1-py3-none-any.whl
| Download URL | djspa-1.0.1-py3-none-any.whl |
|---|---|
| Size | 23.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5c5a661a002d076baf4bb5d61c9e9b8c12912561d3ea29802a45e29dc5cd4654
|
|
BLAKE2b-256 checksum How to use checksums |
2ab2d07c74bda30e6ede0583ef1d91f87e8cc0949b6ca5f76aed96cb07f2cc10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.3
|
Security for djspa 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.