django-constance icon indicating copy to clipboard operation
django-constance copied to clipboard

Constance CLI does not work properly without django admin

Open Alirezaja1384 opened this issue 2 years ago • 0 comments

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

  1. Remove django.contrib.admin from INSTALLED_APPS (And its URL pattern)
  2. Run python manage.py constance --help

System configuration

  • Django version: 4.0.7
  • Python version: 3.10.7
  • Django-Constance version: 2.9.1

Alirezaja1384 avatar Sep 17 '22 10:09 Alirezaja1384