Skip to main content

==============================
django-middleware-public-pages
==============================

Use this App to redirect the requests to 'public' alternative of the same view if the user is not logged in.
For example, if there are two views registered:
- page_private (name=page1)
- page_public (name=page1_pub)
If the user is not authenticated, the middleMiddleware will look for a url-name with the same name and the suffix '_pub' and redirect the request.
If the user is authenticated or the 'public' URL is not found, the Middleware has no effect.


Quick start
-----------

1. Install the app:


1. Add it to your INSTALLED_APPS setting like this::

INSTALLED_APPS = [
...
'django-middleware-public-pages',
]

2. Add the middleware at the end of the list in settings::

MIDDLEWARE_CLASSES = (
...
"django-middleware-public-pages",
)

3. Configure two views, one for authenticated user e.g. page_private and another
for anonymous or public (page_public)::

urlpatterns += [
url("^page_private/$", views.Page1View.as_view(), name="page1"),
url("^page_public/$", views.Page2View.as_view(), name="page1_pub"),
...
]

The middleware will automaticaly redirect "/page_private" to "/page_public" if the user is not
authenticated.
Attention: important is the name of the view and not the url-path.

Project page - https://gitlab.com/rristow/django-middleware-public-pages.git

Metadata

Release files for django-middleware-public-pages 0.16

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-middleware-public-pages 0.16
File Size Uploaded Provenance
django-middleware-public-pages-0.16.tar.gz 2.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-middleware-public-pages 0.16
File Interpreter ABI Platform
django_middleware_public_pages-0.16-py3-none-any.whl Python 3 none any Details

Total release size: 6.4 kB

Release files / django-middleware-public-pages-0.16.tar.gz

Download URL django-middleware-public-pages-0.16.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c20af28cff1ececc055f9852c8c872d1a149ba53985090dc27d3e5004702f792
BLAKE2b-256 checksum
How to use checksums
7ab61bc1d355e28c1244fefdb9b1b71dd8a82cf4748094f0c11bdfc6b1513d70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release files / django_middleware_public_pages-0.16-py3-none-any.whl

Download URL django_middleware_public_pages-0.16-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1eecad4c06a880eed14aa8dd91fb85d90b35429c4b6862c365493721a7b2a5c3
BLAKE2b-256 checksum
How to use checksums
65d4bda11c62e039aa3fe27121c664eedf2bc6ee1c59e88e2f9bbb44fead923a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Security for django-middleware-public-pages 0.16

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.

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