Posts

Showing posts with the label django

Django 3.2 exception: django.core.exceptions.ImproperlyConfigured

3 1 I'm upgrading to django 3.2 but as per it's release notes, it says: The SECRET_KEY setting is now checked for a valid value upon first access, rather than when settings are first loaded. This enables running management commands that do not rely on the SECRET_KEY without needing to provide a value. As a consequence of this, calling configure() without providing a valid SECRET_KEY, and then going on to access settings.SECRET_KEY will now raise an ImproperlyConfigured exception. Error: django.core.exceptions.ImproperlyConfigured: Cannot import 'users'. Check that 'apps.users.apps.UsersConfig.name' is correct. Users apps.py: from django.apps import AppConfig class UsersConfig(AppConfig): name = 'users' I think that error is be...

Auto-create primary key used when not defining a primary key type warning in Django

29 3 I just updated my python from 3.9.1 to 3.9.4. When I tried to run the server. The console gave me a warning for this: WARNINGS: learning_logs.Entry: (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 LearningLogsConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. learning_logs.Topic: (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 LearningLogsConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.d...