Skip to content
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

Django 3.2: multiple warnings #2826

Closed
danjac opened this issue Apr 6, 2021 · 3 comments · Fixed by #2829
Closed

Django 3.2: multiple warnings #2826

danjac opened this issue Apr 6, 2021 · 3 comments · Fixed by #2829

Comments

@danjac
Copy link

danjac commented Apr 6, 2021

Django 3.2 (released today) generates a number of deprecation and other warnings, for example:

HINT: Configure the DEFAULT_AUTO_FIELD setting or the AccountConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.

RemovedInDjango41Warning: 'allauth.account' defines default_app_config = 'allauth.account.apps.AccountConfig'. Django now detects this configuration automatically. You can remove default_app_config.

@djpeacher
Copy link

Looks like adding DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' to settings.py is a temp solution.

https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys

@Flimm
Copy link
Contributor

Flimm commented Apr 8, 2021

The trouble with setting DEFAULT_AUTO_FIELD to 'django.db.models.BigAutoField' in settings.py is this: when you run python manage.py makemigrations, a new migrations file will be created for allauth. If you're using a virtualenv that is not checked into version control, this is not ideal.

Instead, it is better to override apps.py in your application code, as explained in this answer: https://stackoverflow.com/a/67007098/247696

I recommend that django-allauth modify apps.py to avoid this warning. I'll be submitting a pull request soon.

@9mido
Copy link
Contributor

9mido commented Apr 8, 2021

Great job @Flimm that was a perfect explanation and thanks for the PR. And great thanks to everyone else involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants