You don’t run model files directly, but rather through manage.py which 
references your settings.py file.

./manage.py

hth

- Tom

> On Oct 15, 2022, at 1:07 PM, It's ShAdAn <shadanalv...@gmail.com> wrote:
> 
>   Got error
> 
> 
> /usr/bin/python3.9 
> /home/user/PycharmProjects/pythonProject4/mycham/abcd/models.py 
> Traceback (most recent call last):
>   File "/home/user/PycharmProjects/pythonProject4/mycham/abcd/models.py", 
> line 4, in <module>
>     class Person(models.Model):
>   File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 108, 
> in __new__
>     app_config = apps.get_containing_app_config(module)
>   File "/usr/lib/python3/dist-packages/django/apps/registry.py", line 253, in 
> get_containing_app_config
>     self.check_apps_ready()
>   File "/usr/lib/python3/dist-packages/django/apps/registry.py", line 135, in 
> check_apps_ready
>     settings.INSTALLED_APPS
>   File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 82, in 
> __getattr__
>     self._setup(name)
>   File "/usr/lib/python3/dist-packages/django/conf/__init__.py", line 63, in 
> _setup
>     raise ImproperlyConfigured(
> 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.
> 
> Process finished with exit code 1
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com 
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/591dc7a3-2a13-4bc5-9ecb-b939a5688f34n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/591dc7a3-2a13-4bc5-9ecb-b939a5688f34n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/70CF378B-AAE9-4B85-A125-E521489CC1CE%40gmail.com.

Reply via email to