0

I started a django project yesterday using pyCharm professional as text editor. Very thing was working well before I shoutdown my system. But after I restart my system, I started getting this error.

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2020.1.3\plugins\python\helpers\pycharm\django_manage.py", line 59, in <module>
    run_command()
  File "C:\Program Files\JetBrains\PyCharm 2020.1.3\plugins\python\helpers\pycharm\django_manage.py", line 46, in run_command
    run_module(manage_file, None, '__main__', True)
  File "C:\Users\OBUM\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "C:\Users\OBUM\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "C:\Users\OBUM\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:/Users/OBUM/PycharmProjects/newproject\manage.py", line 21, in <module>
    main()
  File "C:/Users/OBUM/PycharmProjects/newproject\manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\OBUM\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "C:\Users\OBUM\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\OBUM\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Users\OBUM\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
    super().execute(*args, **options)
  File "C:\Users\OBUM\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "C:\Users\OBUM\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\commands\runserver.py", line 67, in handle
    if not settings.DEBUG and not settings.ALLOWED_HOSTS:
  File "C:\Users\OBUM\AppData\Local\Programs\Python\Python38\lib\site-packages\django\conf\__init__.py", line 79, in __getattr__
    self._setup(name)
  File "C:\Users\OBUM\AppData\Local\Programs\Python\Python38\lib\site-packages\django\conf\__init__.py", line 60, in _setup
    raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Requested setting DEBUG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

Can someone help me please

  • please check out [here](https://stackoverflow.com/questions/15556499/django-db-settings-improperly-configured-error) for a solution. – Jeffrey Jul 14 '20 at 08:03

1 Answers1

0

that will happen sometimes when your trying to run your app with 'run' icon (green triangle). try this command in the terminal :

python manage.py runserver
babak gholamirad
  • 407
  • 4
  • 10