I'm trying to add initial data in Django 1.7 and I've read that it is recommended to use data migrations.
I've created my migration file correctly, called "0001_groups", in which I create few contrib.auth
's groups and permissions.
The problem is that it is run before the auth
migrations are run.
I went to find out what't the name of the last migration of the auth
app, and it's called 0005_alter_user_last_login_null.py
. So I tried with:
dependencies = [
('auth', '0005_alter_user_last_login_null'),
]
but I get:
KeyError: u"Migration appname.0001_groups dependencies references nonexistent parent node ('auth', '0005_alter_user_last_login_null')"
I've googled that error and it always links to 11 months old fixed bugs of Django.
How can I correctly specify the auth
app dependency?
I've found out that you can reference the last migration with __latest__
:
dependencies = [
('auth', '__latest__'),
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With