django-public-admin-mixins
WARNING: Using this app may introduce security issues. We don't recommend using it in production. Use at you own risk.
This app helps developers create public interfaces using the django admin. That is, an interface where no login is required, and all users only have view permission on models.
There is another app,
django-public-admin,
which implements a similar funcionality, but uses child classes instead
of mixins. For small admin projects it should be quicker to setup, but
these mixins allow for more configurability.
Installation
$ pip install django-public-admin-mixins- Add
public_adminto youINSTALLED_APPS, beforedjango.contrib.admin
Usage
To make the admin interface public, one must configure both the admin
site and the ModelAdmin classes that are registered to that site. For
that, django-public-admin-mixins exposes two mixins:
PublicAdminSiteMixin and PulbicModelAdminMixin. To use the former,
one must use a custom admin site. More details can be found
here,
but the basic idea for overriding the default admin site is as follows:
# myproject/admin.py
from django.contrib import admin
from django_public_admin.admin import PublicAdminSiteMixin
class PublicAdminSite(PublicAdminSiteMixin, admin.AdminSite):
pass
# myproject/apps.py
from django.contrib.admin.apps import AdminConfig
class PublicAdminConfig(AdminConfig):
default_site = "myproject.admin.PublicAdminSite"
# myproject/settings.py
INSTALLED_APPS = [
# ...
"myproject.apps.PublicAdminConfig", # replaces 'django.contrib.admin'
# ...
]
When registering a model to this admin site, use a custom model admin which uses our mixin:
# myapp/admin.py
from django.contrib import admin
from django_public_admin.admin import PublicModelAdminMixin
from .models import MyModel
class PublicModelAdmin(PublicModelAdminMixin, admin.ModelAdmin):
pass
admin.site.register(MyModel, PublicModelAdmin)
Templates
This app ships with templates to override links in the head of the site
that aren't suited to a public admin, like the ones for login and
logout. If you decide to use your own, there is no need to add the app
to the INSTALLED_APPS list.
Metadata
Release files for django-public-admin-mixins 0.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 |
|---|---|---|---|---|
| django_public_admin_mixins-0.0.1.tar.gz | 3.2 kB | Without provenance | Details for django_public_admin_mixins-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_public_admin_mixins-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for django_public_admin_mixins-0.0.1-py3-none-any.whl |
Total release size: 7.9 kB
Release files / django_public_admin_mixins-0.0.1.tar.gz
| Download URL | django_public_admin_mixins-0.0.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01bd25837cc86770455e3f093f71aae233f003765d536be6ab9cdaaaa40615c4
|
|
BLAKE2b-256 checksum How to use checksums |
73b8fdddcc59a0e731ac743757bd3f9c78d9cad4ebfce80b72009c87b0367789
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Release files / django_public_admin_mixins-0.0.1-py3-none-any.whl
| Download URL | django_public_admin_mixins-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4e366bb4ac9ec1b29750bb8e23fde20706977a0869db207ebfa9435f76ee013
|
|
BLAKE2b-256 checksum How to use checksums |
ff00ccdc62dc8c54f8c387953ef0a018db13af2864f50bb2eb14528cb4497f57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Security for django-public-admin-mixins 0.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.