Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applications in subfolder in 1.7

I have a projectfolder structure like this:

project
    applications
        __init__.py
        app1
        app2
        app3
    project
        __init__.py
        settings.py 

In my settings.py Im trying to import the apps like this:

INSTALLED_APPS = (
    'django.contrib.admin',
    ...

    'applications.app1',
    'applications.app2',
    'applications.app3',
)

But if I try to migrate one of the app, I get this error:

./manage.py makemigrations applications.app1
App 'applications.app1' could not be found. Is it in INSTALLED_APPS?

What could be wrong? This kind of setup used to work with django 1.6

like image 490
Tomas Jacobsen Avatar asked Nov 14 '14 11:11

Tomas Jacobsen


1 Answers

There is actually a Django-native solution to this. From the docs:

Many commands take a list of “app names.” An “app name” is the basename of the package containing your models. For example, if your INSTALLED_APPS contains the string 'mysite.blog', the app name is blog.

like image 168
davidhwang Avatar answered Sep 24 '22 00:09

davidhwang