-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set default_auto_field to 'AutoField' #2829
Conversation
This will avoid warnings in Django 3.2 and will avoid the creation of new migrations.
What's the status of this issue? Any plans for a merge/release anytime soon? |
It would be better to migrate all the models to |
Yeah agreed that makes sense in the long term. In the short term the creation of these migrations can be problematic for new projects, which can easily introduce migrations that depend on files that only exist in a virtualenv on a single dev's machine, and then lead to confusing "missing migration" error when trying to deploy on another environment. If the release process isn't too painful, do you think it might make sense to roll the fixes out in two stages to avoid people getting tripped up in the interim? |
Two fixes would be a good idea, yes. (I am not a maintainer, just a user.) |
While waiting for this to be merged, what's a regular user to do to at least temporary suppress the warning without triggering a migration file at least? |
My post on Stack Overflow explains a workaround. Also, be aware of this bug #2853. |
Thank you. HOwever, when I followed your workaround including the one for bug #2853, i get the following
Suggestions? UpdateForget it. I just realized is similar to the issue raised by @Flimm So I wrote the workaround in #2946 |
@pennersr This is an important compatibility fix for Django 3.2, and it's generated significant user attention. Could you please review this? After this is merged, could we also get a PyPI release? |
Yay! Thank you for merging. |
@pennersr Thanks! Could you issue a new PyPI release to include this change? |
I had this problem! Waiting for this to be released 😄 @pennersr any update? |
The latest release on PyPI does contain the fix, now. |
Django 3.2 introduces DEFAULT_AUTO_FIELD . If you set this to something other than
'django.db.models.AutoField'
, migrations will need to be generated for allauth's models. This pull request setsdefault_auto_field
just for these apps so that no migrations need to be generated.It also hides warnings on Django 3.2.
Fixes: #2826