A django-read-only-admin documentation
django-read-only-admin is a Django reusable application that fully implement read only admin
Installation
Obtain your copy of source code from the git repository: $ git clone https://github.com/vint21h/django-read-only-admin.git. Or download the latest release from https://github.com/vint21h/django-read-only-admin/tags/.
Run $ python ./setup.py install from the repository source tree or the unpacked archive. Or use pip: $ pip install django-read-only-admin.
Configuration
Add "read_only_admin" to settings.INSTALLED_APPS.
# settings.py
INSTALLED_APPS += [
"read_only_admin",
]
Run $ python ./manage.py migrate.
Then add user/group change/delete/add/readonly model permissions.
Settings
- READ_ONLY_ADMIN_PERMISSION_PREFIX
Read-only permission prefix. Defaults to: "readonly".
- READ_ONLY_ADMIN_PERMISSION_NAME_PREFIX
Read-only permission name prefix. Defaults to: "Read only".
- READ_ONLY_ADMIN_EMPTY_ACTIONS
Empty admin actions list (exclude superusers) or just remove delete selected action. Defaults to: True.
Usage
Just inherit your custom Django admin class from read_only_admin.admin.ReadonlyAdmin.
# admin.py
from read_only_admin.admin import ReadonlyAdmin
class MyCustomAdmin(ReadonlyAdmin):
...
Also tabular and stacked inlines are supported.
# admin.py
from read_only_admin.admin import (
ReadonlyStackedInline,
ReadonlyTabularInline,
)
class MyCustomTabularInline(ReadonlyTabularInline):
model: Type[Model] = MyModel
extra: int = 0
class MyCustomStackedInline(ReadonlyStackedInline):
model: Type[Model] = MyModel
extra: int = 0
If you use list_editable in your custom admin classes, copy read_only_admin/templates/admin/pagination.html to your project templates/admin directory.
Contributing
Install GNU Make
Install and configure pyenv and pyenv-virtualenv plugin
Install and configure direnv
Create environment config from example
cp .env.example .env
Install development dependencies:
make install
Create your fix/feature branch:
git checkout -b my-new-fix-or-feature
Check code style and moreover:
make check
Run tests:
make test
Push to the branch:
git push origin my-new-fix-or-feature
Licensing
django-read-only-admin uses the MIT license. Please check the MIT-LICENSE file for more details.
Some part of code fairly stolen from teh internets with reference to the source. So, if you author of this code, please contact me.
Contacts
Project Website: https://github.com/vint21h/django-read-only-admin/
Author: Alexei Andrushievich <vint21h@vint21h.pp.ua>
For other authors list see AUTHORS file.
Metadata
Release files for django-read-only-admin 0.17.5
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-read-only-admin-0.17.5.zip | 28.6 kB | Without provenance | Details for django-read-only-admin-0.17.5.zip |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_read_only_admin-0.17.5-py3-none-any.whl | Python 3 | none | any | Details for django_read_only_admin-0.17.5-py3-none-any.whl |
Total release size: 45.0 kB
Release files / django-read-only-admin-0.17.5.zip
| Download URL | django-read-only-admin-0.17.5.zip |
|---|---|
| Size | 28.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b181d7153bb27d59c2820ca12d58af6805f9f50b43d786221981722a337862e4
|
|
BLAKE2b-256 checksum How to use checksums |
2851feceecdcd5103881769fdf10eb17675336231621821756ba67eaaab32786
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|
Release files / django_read_only_admin-0.17.5-py3-none-any.whl
| Download URL | django_read_only_admin-0.17.5-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
912998774ec86790e451aa616524cde8b9e0fe08a6bfb1ce8960abe77702c963
|
|
BLAKE2b-256 checksum How to use checksums |
af86114287aa7111dcee44aaf444b7df8b5b3888fbacb28aefa66cf6eae44be2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|
Security for django-read-only-admin 0.17.5
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.