Skip to content Skip to sidebar Skip to footer

How Do I Use Django South When My App Is Inside Another Directory?

So by default, Django creates apps inside the root project dir. But I moved it inside 'apps'. py manage.py schemamigration ./apps/chat --initial This doesn't work. Instead of 'ch

Solution 1:

is apps python module or just directory?

if apps python modue, add apps.chat to installed apps in settings.py

and run

py manage.py  schemamigration chat --initial

if apps is just directory, so you need to add this directory to your PYTHONPATH. add these lines at near top of your manage.py

import os
import sys
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
APPS_ROOT = os.path.join(SITE_ROOT, 'apps')
sys.path.append(APPS_ROOT)

add chat to your settings.

now run

py manage.py  schemamigration chat --initial

and don't forget to add south to installed apps for both.

Post a Comment for "How Do I Use Django South When My App Is Inside Another Directory?"