3đź‘Ť
migrations exist on a per-app basis. each app may or may not have its own migrations, but you need to create them for each app where you want to use them. (often all apps)
./manage.py migrate
is a shortcut that runs migrations for all apps
7đź‘Ť
This error can be misleading: it is thrown not when South tries to import the app, but when it tries to get the app’s models
module.
- perhaps it cannot import the application (because you didn’t add its name to
INSTALLED_APPS
) - perhaps it cannot import the
models
module, because the filemodels.py
does not exist, or because the directorymodels/
does not contain an__init__.py
.
South doesn’t import the models
module itself. Instead, it leaves that job to django.db.models.get_app('app_of_interest')
, which according to its docstring “Returns the module containing the models for the given app_label.” The error message raised by get_app
is, in fact, different depending on whether it failed to import the app or the model, but both exceptions are ImproperlyConfigured
, and the schemamigrations
script doesn’t look any deeper than that.
Because South says it is accepting security updates only (it entered end-of-life with Django 1.7’s migration feature), I’m not submitting a fix to its codebase, but instead documenting the problem here.
- TypeError: create_superuser() missing 1 required positional argument: 'profile_picture'
- How to use the admin autocomplete field in a custom form?
- Django i18n default language without path prefixes
- When trying set corsheaders in settings.py file
- How to use email instead of username for user authentication?
3đź‘Ť
Check once whether you have included the app name in INSTALLED_APPS in settings.py
- What permissions does django-storages require for an s3 IAM user?
- How to run a Django celery task every 6am and 6pm daily?