Python Forum
After using models.Model on my class Im getting 'ImproperlyConfigured' error Django
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
After using models.Model on my class Im getting 'ImproperlyConfigured' error Django
#1
Photo 
This question is not only about Python but about Django framework as well.

1. I just started a new project in django, I run the command 'django-admin startproject + project_name', and 'python manage.py startapp + app_name'.
It creates a project and app.

1. I also added my new app to the settings:[Image: aMIpy.png]

2.After that I tried to create my first module on 'modules.py' file on my app, but when I do it and run the file, it gives me this error message:[Image: LX3n1.png]

The entire error message says: " django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. "

I created a few projects before, and never saw this problem.

I discovered that if I dont use the 'models.Model' on my class, it does not gives me this error.[Image: v5Dg2.png]

Someone knows what it is about? I didnt change anything on settings file, just added the app name. Maybe its normal to have this error message, when we run the 'modules.py' file, and we should just ignore it?

Thank you!
Larz60+ write Apr-05-2021, 10:11 PM:
Please use bbcode tags to show codeRefer to BBCode not images,
Reply
#2
Try running python manage.py makemigrations and python manage.py migrate
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python django view error ZeeKolachi 1 351 Mar-18-2024, 03:14 PM
Last Post: Sowmya
  Django: View is unable to find attributes of database model pythonpaul32 0 523 Dec-07-2023, 06:38 PM
Last Post: pythonpaul32
  Querying Django model db - from Jose Portilla’s Udemy course Drone4four 2 1,706 Aug-09-2022, 09:25 AM
Last Post: Addweb
  Error - ManyToMany Fields in Django rob25111 0 1,533 Jan-17-2021, 04:58 PM
Last Post: rob25111
  [Django]calculate value in model smabubakkar 0 1,665 Apr-15-2020, 03:40 PM
Last Post: smabubakkar
  Django - Am I in the right direction for creating the models of my Phone Review appli shawnmichaels583583 0 1,834 Oct-15-2019, 06:25 AM
Last Post: shawnmichaels583583
  Posting html values to views/models in Django Malt 1 2,166 Sep-04-2019, 01:44 PM
Last Post: fishhook
  upload big file in Django with process bar and i get error : MemoryError ma_norouzifar 3 4,404 Aug-06-2019, 06:57 AM
Last Post: fishhook
  Django Python Vscode Error Please Help Smhbugra 3 2,718 Jun-30-2019, 10:54 AM
Last Post: noisefloor
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,315 Jun-30-2019, 12:21 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020