3👍
✅
You’re using 1.7
but looking at the master
source tree. See this and try 0001_initial
.
20👍
I’ve found out that you can reference the last migration with __latest__
:
dependencies = [
('auth', '__latest__'),
]
👤Shoe
- Django form and i18n
- Django formset – show extra fields only when no initial data set?
- DJANGO: How to list_display a reverse foreign key attribute?
- Django – links generated with {% url %} – how to make them secure?
- Django: Save user uploads in seperate folders
0👍
In my case, I wanted to depend on the very first migration of whatever the django.conf.setting.AUTH_USER_MODEL
is set to, so that I don’t have to hard-code the app name in my code.
The following will do just that:
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
which is equivalent to:
dependencies = [(settings.AUTH_USER_MODEL.rsplit(".")[0], "__first__")]
- Display user group in admin interface?
- Django Raw SQL give me TypeError not enough arguments
- Reading multidimensional arrays from a POST request in Django
- PASSWORD_HASHERS setting in Django
- Django: Implementing a referral program
Source:stackexchange.com