As the title says, I can\'t seem to get migrations working.
The app was originally under 1.6, so I understand that migrations won\'t be there initially, and indeed i
This may happen due to the following reasons:
INSTALLED_APPS
list in settings.py
(You have to add either the app name or the dotted path to the subclass of AppConfig in apps.py in the app folder, depending on the version of django you are using). Refer documentation: INSTALLED_APPS migrations
folder inside those apps. (Solution: just create that folder).__init__.py
file inside migrations
folder of those apps. (Solution: Just create an empty file with name __init__.py)__init__.py
file inside the app folder. (Solution: Just create an empty file with name __init__.py)models.py
file in the appmodels.py
doesn't inherit django.db.models.Model
models.py
Note:
A common mistake is to add migrations
folder in .gitignore
file. When cloned from remote repo, migrations
folder and/or __init__.py
files will be missing in local repo. This causes problem.
I suggest to gitignore migration files by adding the following lines to .gitignore
file
*/migrations/*
!*/migrations/__init__.py