ModuleNotFoundError: No module named 'DivusX.StartSite'

Hey,

I’ve added a Model to my admin.py as an import

admin.py

from django.contrib import admin
from .models import Account

admin.site.register(Account)

But if I hit the migrate command an error messages appears

  File "D:\Developement\Projekte\DivusX\DivusX\StartSite\forms.py", line 1, in <module>
    from DivusX.StartSite.models import Account
ModuleNotFoundError: No module named 'DivusX.StartSite'

I guess the path from the import or something is wrong.

What is the base dir of your project? In what directory is the Account model file located?

base dir:
D:\Developement\Projekte\DivusX\DivusX

models:
D:\Developement\Projekte\DivusX\DivusX\StartSite

Try with

from StartSite.models import Account
2 Likes