From 05565b1c60d48b7918a357efb641f4b3c41d82dd Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 16 Sep 2021 17:21:47 -0700 Subject: [PATCH] settings: Set Django auto field type explicitly This is already the default (Django 3.2), however, setting it explicitly seems to avoid a warning while running 'django-admin makemigrations'. Tests: - Add SECRET_KEY to settings.py temporarily. Run the command 'django-admin makemigrations --pythonpath=. --settings=plinth.settings'. There should no warnings related DEFAULT_AUTO_FIELD not being set. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/settings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plinth/settings.py b/plinth/settings.py index dbdd97f35..5845c3dd3 100644 --- a/plinth/settings.py +++ b/plinth/settings.py @@ -78,6 +78,10 @@ DATABASES = { # Overridden based on command line argument --develop DEBUG = False +# This is already the default (Django 3.2), however, setting it explicitly +# seems to avoid a warning while running 'django-admin makemigrations'. +DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' + # Overridden based on the configuration key server_dir FORCE_SCRIPT_NAME = '/plinth'