Django Admin Generator is a management command to automatically generate a Django `admin.py` file for given apps/models.
Project description
Django Admin Generator
The Django Admin Generator is a project which can automatically generate (scaffold) a Django Admin for you. By doing this it will introspect your models and automatically generate an Admin with properties like:
list_displayfor all local fieldslist_filterfor foreign keys with few itemsraw_id_fieldsfor foreign keys with a lot of itemssearch_fieldsfornameandslugfieldsprepopulated_fieldsforslugfieldsdate_hierarchyforcreated_at,updated_atorjoined_atfields
Links
- Documentation: https://django-admin-generator.readthedocs.io/en/latest/
- Source: https://github.com/WoLpH/django-admin-generator
- Bug reports: https://github.com/WoLpH/django-admin-generator/issues
- Package homepage: https://pypi.org/project/django-admin-generator/
- My blog: https://w.wol.ph/
Install
-
Install the package:
pip install django-admin-generator
-
Add
django_admin_generatorto yourINSTALLED_APPS.
Usage
To generate an admin for a given app:
./manage.py admin_generator APP_NAME >> APP_NAME/admin.py
To generate an admin for a given app with all models starting with user:
./manage.py admin_generator APP_NAME '^user' >> APP_NAME/admin.py
To write the generated admin directly to each app's admin.py:
./manage.py admin_generator APP_NAME --write
Use all as the app name to generate admins for every local (i.e. not in
site-packages) app:
./manage.py admin_generator all
Live demo
A self-documenting blog demo whose admin.py is fully auto-generated:
uv run --extra demo python test_project/manage.py demo # or: tox -e demo
Then open http://127.0.0.1:8000/admin/ and log in with admin / admin. The
admin index explains what was generated and why. See
test_project/README.md
for a guided tour.
Development
uv sync --extra dev # create the environment
uv run pytest # run the tests
uv run ruff check . # lint
uv run tox # full matrix (tests, lint, types, docs)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 django_admin_generator-3.0.0.tar.gz.
File metadata
- Download URL: django_admin_generator-3.0.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b8ac607f6623a4bcf9b3e618d108c7d5152e86fb3df55683b0ab29953ba73d2
|
|
| MD5 |
708942fa0da669a1c936358f105d5aa6
|
|
| BLAKE2b-256 |
99dfbaaa52650de06818ca694ef0ad08d92edbcf2e1bbc8e77072123416cb73b
|
Provenance
The following attestation bundles were made for django_admin_generator-3.0.0.tar.gz:
Publisher:
publish.yml on wolph/django-admin-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_admin_generator-3.0.0.tar.gz -
Subject digest:
1b8ac607f6623a4bcf9b3e618d108c7d5152e86fb3df55683b0ab29953ba73d2 - Sigstore transparency entry: 1870887419
- Sigstore integration time:
-
Permalink:
wolph/django-admin-generator@0da3101aed56e9f772691b74777257648be1f62c -
Branch / Tag:
refs/tags/v3.0.0 - Owner: https://github.com/wolph
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0da3101aed56e9f772691b74777257648be1f62c -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_admin_generator-3.0.0-py3-none-any.whl.
File metadata
- Download URL: django_admin_generator-3.0.0-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c598341e2beebe3448c1686a4897e8ef1837013925986f7b15dfb9279156447f
|
|
| MD5 |
41334a17ac5afe063ccd214fb3edf4c8
|
|
| BLAKE2b-256 |
8602c0c0dd2134c5db4a8e456c8ecf372a051b1cb96404e583525227361cc3ef
|
Provenance
The following attestation bundles were made for django_admin_generator-3.0.0-py3-none-any.whl:
Publisher:
publish.yml on wolph/django-admin-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_admin_generator-3.0.0-py3-none-any.whl -
Subject digest:
c598341e2beebe3448c1686a4897e8ef1837013925986f7b15dfb9279156447f - Sigstore transparency entry: 1870887430
- Sigstore integration time:
-
Permalink:
wolph/django-admin-generator@0da3101aed56e9f772691b74777257648be1f62c -
Branch / Tag:
refs/tags/v3.0.0 - Owner: https://github.com/wolph
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0da3101aed56e9f772691b74777257648be1f62c -
Trigger Event:
push
-
Statement type: