Alan Coleman

I’m Alan Coleman, a Full Stack Software and DevOps Engineer based in the UK.

Latest blog post

I encountered an error whilst building an application in Python this morning, I had the feeling that it would be a naming issue and a Stackoverflow post confirmed this.

The problem arose when attempting to build a model migration file using makemigrations

python makemigrations

Which returned the following error:

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

The solution? The name in should be the same value that you put in INSTALLED_APPS in

from django.apps import AppConfig

class AccountsConfig(AppConfig):
    default_auto_field = "django.db.models.BigAutoField"
    name = "mysite.apps.accounts"