django-constance
django-constance copied to clipboard
Constance CLI does not work properly without django admin
Describe the problem
It seems disabling django admin's app breaks the constance CLI. As I noticed constance/management/commands/constance.py
imports ConstanceForm
and get_values
from admin configuration. The problem is admin.py
tries to register the constance's config class and since the admin app is not present in INSTALLED_APPS
django throws a LookupError
.
I think splitting ConstanceForm
and get_values
to a separate module (like forms.py
) and importing them directly from that module can easily fix the problem.
Steps to reproduce
- Remove
django.contrib.admin
fromINSTALLED_APPS
(And its URL pattern) - Run
python manage.py constance --help
System configuration
- Django version: 4.0.7
- Python version: 3.10.7
- Django-Constance version: 2.9.1