Django Error upon running the system

147 views
Skip to first unread message

Davin Pore

unread,
Aug 6, 2019, 12:45:22 AM8/6/19
to Django users
Could you help me to fix this issue. I encountered while running the system.

C:\Users\davin.l.pore\Documents\JFETM_BMS\jfetmbox\venv\Scripts\python.exe C:/Users/davin.l.pore/Documents/JFETM_BMS/JFETM/Box_Cronjob/box/cronjob/b0302_get_folder_file.py
Traceback (most recent call last):
  File "C:/Users/davin.l.pore/Documents/JFETM_BMS/JFETM/Box_Cronjob/box/cronjob/b0302_get_folder_file.py", line 13, in <module>
    from box.models import User
  File "C:\Users\davin.l.pore\Documents\JFETM_BMS\JFETM\Box_Cronjob\box\models.py", line 17, in <module>
    class GroupCompany(models.Model):
  File "C:\Users\davin.l.pore\Documents\JFETM_BMS\jfetmbox\venv\lib\site-packages\django\db\models\base.py", line 103, in __new__
    app_config = apps.get_containing_app_config(module)
  File "C:\Users\davin.l.pore\Documents\JFETM_BMS\jfetmbox\venv\lib\site-packages\django\apps\registry.py", line 252, in get_containing_app_config
    self.check_apps_ready()
  File "C:\Users\davin.l.pore\Documents\JFETM_BMS\jfetmbox\venv\lib\site-packages\django\apps\registry.py", line 134, in check_apps_ready
    settings.INSTALLED_APPS
  File "C:\Users\davin.l.pore\Documents\JFETM_BMS\jfetmbox\venv\lib\site-packages\django\conf\__init__.py", line 79, in __getattr__
    self._setup(name)
  File "C:\Users\davin.l.pore\Documents\JFETM_BMS\jfetmbox\venv\lib\site-packages\django\conf\__init__.py", line 64, in _setup
    % (desc, ENVIRONMENT_VARIABLE))
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

Mike Dewhirst

unread,
Aug 6, 2019, 1:06:05 AM8/6/19
to django...@googlegroups.com
On 6/08/2019 10:45 am, Davin Pore wrote:
> Could you help me to fix this issue. I encountered while running the
> system.

Your command line needs an extra argument --settings=<path-to-settings>
where that might be worked out from ...

https://docs.djangoproject.com/en/2.2/topics/settings/#designating-the-settings
> --
> 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...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c7f195d5-7481-43d2-ba87-7a9540286714%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c7f195d5-7481-43d2-ba87-7a9540286714%40googlegroups.com?utm_medium=email&utm_source=footer>.

DANIEL URBANO DE LA RUA

unread,
Aug 6, 2019, 1:07:45 AM8/6/19
to django...@googlegroups.com
not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE y have the trik in the logs

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c7f195d5-7481-43d2-ba87-7a9540286714%40googlegroups.com.

胡超

unread,
Aug 6, 2019, 2:15:40 AM8/6/19
to django...@googlegroups.com
Please post the contents of your settings file.  I guess your settings file is wrongs.

Davin Pore

unread,
Aug 7, 2019, 5:34:28 AM8/7/19
to Django users
Hi 

 How I would define the the environment variable DJANGO_SETTINGS_MODULE
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.

Mike Dewhirst

unread,
Aug 7, 2019, 6:01:47 AM8/7/19
to django...@googlegroups.com
On 7/08/2019 3:34 pm, Davin Pore wrote:
> Hi
>
>  How I would define the the environment variable DJANGO_SETTINGS_MODULE

In Windows Explorer, right-click 'This PC' then select 'Properties' and
finally 'Advanced system settings'. You will see a button labelled
[Environment variables]

However this can lead to insanity. I speak from personal experience.

Instead, you should specify it at the end of your command line with
--settings=<path-to-settings>

for example ...

C:\<path-to-venv>\python manage.py runserver --settings=projname.settings

https://docs.djangoproject.com/en/2.1/topics/settings/#the-django-admin-utility
> it, send an email to django...@googlegroups.com <javascript:>.
> <https://groups.google.com/d/msgid/django-users/c7f195d5-7481-43d2-ba87-7a9540286714%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...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4e1375a1-cb14-4c99-b21a-505ad33843ed%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4e1375a1-cb14-4c99-b21a-505ad33843ed%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages