A Django app to check that all models have been added to the Django admin site.
Project description
django-check-admin is a Django app that adds a system check to verify that all models have been registered with the Django admin site. This check is useful if all models of a project should normally be registered.
Installation
Install the package with pip:
$ pip install django-check-admin
Add 'checkadmin' to INSTALLED_APPS.
INSTALLED_APPS = [
...
'checkadmin',
]
Running
Use the Django management command check:
$ python manage.py check
If a model is not registered with the Django admin site, an error will be emitted. For example:
The model myapp.MyModel is not registered with an admin site.
If specific models should be ignored by the check, use checkadmin.ignore() or define a list of ignored models in your settings with CHECK_ADMIN_IGNORED_MODELS:
import checkadmin
from myapp.models import MyModel
checkadmin.ignore(MyModel)
CHECK_ADMIN_IGNORED_MODELS = ["myapp.MyModel"]
Now, even if MyModel is not registered with an admin site, an error will not be emitted.
Project details
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
File details
Details for the file django-check-admin-1.2.0.tar.gz
.
File metadata
- Download URL: django-check-admin-1.2.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f71d74f215dc89497b255218faa68b64aa31647e28f780619258459a1b28f27 |
|
MD5 | 40dbe6f40392af5e125a57322fbd864a |
|
BLAKE2b-256 | aade97c7e955debcdbc016480792994986be59e432226bd5342cbd333817274f |
File details
Details for the file django_check_admin-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: django_check_admin-1.2.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2770211387568a8e64028395b1f2b79910fabb7127e39cdb92deca6b1ae53741 |
|
MD5 | ecd404f713e5e9e657dbe6fc2a4b1d39 |
|
BLAKE2b-256 | cfda1cc5113ef2b3d89a3f7534e6dc1353cc2ab20461844a3bae0bc11d56b10c |