Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django.core.exceptions.ImproperlyConfigured: Cannot import 'category'. Check that 'api.category.apps.CategoryConfig.name' is correct

I am using Django 3.2, and Django REST Framework. Main project name is ECOM and api is app. Inside api there are multiple apps like category, migrations, order, payment, product, user. Now I want to inform ecom.settings about installed api. HOW I should do it ?

settings.py of ECOM :

INSTALLED_APPS = [
     #other basic install
    'corsheaders',
    'rest_framework',
    'rest_framework.authtoken',
    'api',
    'api.category',
]

but getting error.

My category apps.py file looks like

class CategoryConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'category'
like image 884
Ravi Shankar Avatar asked Oct 24 '25 02:10

Ravi Shankar


1 Answers

Try to change name in your category apps.py like this

class CategoryConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'api.category'
like image 171
Ankit Tiwari Avatar answered Oct 25 '25 15:10

Ankit Tiwari



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!