Error: Cannot import 'account'. Check that 'accounts.apps.AccountConfig.name' is correct

When I run python manage.py runserver in Django, I get the following error.

Error

django.core.exceptions.ImproperlyConfigured: Cannot import 'account'. Check that 'accounts.apps.AccountConfig.name' is correct.

I tried everything but could not figure it out.

What should I do?

acconuts/apps.py

from django.apps import AppConfig


class AccountConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'account'

mysite/settings.py

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'widget_tweaks',
    'app',
    'accounts',
    'django.contrib.sites',
    'allauth',
    'allauth.account',
    'allauth.socialaccount',
]

Instead of account your app is named accounts. Also, you shared file acconuts/apps.py - is that also your mispell?

class AccountConfig(AppConfig):
    ...
    name = 'accounts'   # it has to be exactly as your app name
Back to Top