Given a newly created django project with the following installed apps:
INSTALLED_APPS = (
\'django.contrib.admin\',
\'django.contrib.auth\',
\'django.contrib.co
Once you create a migration for your app it will automatically add the necessary dependencies. So in this case just run ./manage.py makemigrations registration
.
Please check the registration/migrations/0001_initial.py file and you should see something like this:
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
This means you need to create migrations for all your apps with any kind of dependency.
I had this problem too, solved it by replacing old registration with one that includes pull #25:
pip install git+https://github.com/macropin/django-registration.git@v1.2c0
The problem is avoided when you do as Pedro Wagner suggests (auth_user error with Django 1.8 and syncdb / migrate):
Make sure that for all your apps, there exist initial migrations files by running:
manage.py makemigrations my_app
I'd do it not only for those that depend on auth because I think the problem is more general.
The root cause for this behaviour seems to me that for some reason
manage.py makemigrations
does not always create the initial migrations if they are not already there, contrary to:
manage.py makemigrations my_app
Unfortunately I cannot fathom the reasons for this asymmetry.
you have not migrated your models
python manage.py makemigrations my_app_name
for mac os
python3 manage.py makemigrations my_app
I think you needed to run:
python manage.py syncdb
and potentially you need to setup some dependencies? Probably not necessary after syncdb.
class Migration:
depends_on = (
("accounts", "0001"),
)
def forwards(self):
....
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("accounts", "0001")]
After updating my Django version, I got this error and fix as running these two lines:
python manage.py migrate auth
python manage.py migrate
auth_user table inside auth model should run first I guess.