user2436815
user2436815

Reputation: 3905

Django "Installed Apps" sync issue

I have the following Django directory structure:

PROJECT_FOLDER
\__ manage.py
\__ MY_PROJECT
    \__ __init__.py
    \__ settings.py
    \__ urls.py
    \__ wsgi.py
    \__ APPS
        \__ MY_APP
            \__ __init.py
            \__ admin.py
            \__ models.py
            \__ views.py
            \__ tests.py

In settings.py I included my app in the follwing line:

INSTALLED_APPS = (
    ...

    # Applications
    'MY_PROJECT.APPS.MY_APP'
)

But when I do syncdb (python manage.py syncdb), it gives me an error:

ImportError: No module named APPS.MY_APP

In the INSTALLED_APPS, I tried different lines like:

'PROJECT_FOLDER.MY_PROJECT.APPS.MY_APP',
'APPS.MY_APP'

but all of these give me errors...

Is there anything wrong with my settings.py or directory structure???

tHanks

Upvotes: 0

Views: 75

Answers (1)

shaktimaan
shaktimaan

Reputation: 12092

You can check a few things here:

  • If PROJECT_FOLDER is in PYTHONPATH.
  • Create an empty __init__.py file in APPS folder.
  • The __init__.py file in MY_APP is named incorrectly.

Upvotes: 2

Related Questions