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: default_auto_field #44

Closed
fertek opened this issue Dec 21, 2021 · 0 comments · Fixed by #45
Closed

Django 3.2: default_auto_field #44

fertek opened this issue Dec 21, 2021 · 0 comments · Fixed by #45

Comments

@fertek
Copy link

fertek commented Dec 21, 2021

Application django-flatblocks displays this warning when used in Django 3.2:

WARNINGS:
flatblocks.FlatBlock: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
	HINT: Configure the DEFAULT_AUTO_FIELD setting or the AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.

To solve this issue, there should be a apps.py file with the following content:

from django.apps import AppConfig

class FlatblocksConfig(AppConfig):
    default_auto_field = 'django.db.models.AutoField'

More information here and here.

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.

1 participant