Probkem in Django with runserver command
I started a project in django and everything was okay, but i closed my project and fews days later i tried to reopen, but this error appeared when i put the command "django-admin runserver" :
Traceback (most recent call last): File "c:\users\moren\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in run_module_as_main "main", mod_spec) File "c:\users\moren\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users\moren\Envs\myapp\Scripts\django-admin.exe_main.py", line 7, in File "C:\Users\moren\Envs\myapp\lib\site-packages\django\core\management_init.py", line 419, in execute_from_command_line utility.execute() File "C:\Users\moren\Envs\myapp\lib\site-packages\django\core\management_init_.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Users\moren\Envs\myapp\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "C:\Users\moren\Envs\myapp\lib\site-packages\django\core\management\commands\runserver.py", line 61, in execute super().execute(*args, **options) File "C:\Users\moren\Envs\myapp\lib\site-packages\django\core\management\base.py", line 398, in execute output = self.handle(*args, **options) File "C:\Users\moren\Envs\myapp\lib\site-packages\django\core\management\commands\runserver.py", line 68, in handle if not settings.DEBUG and not settings.ALLOWED_HOSTS: File "C:\Users\moren\Envs\myapp\lib\site-packages\django\conf_init_.py", line 82, in getattr self.setup(name) File "C:\Users\moren\Envs\myapp\lib\site-packages\django\conf_init.py", line 67, in _setup % (desc, ENVIRONMENT_VARIABLE)) 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.
And when i put "python manage.py runserver" this appear :
c:\users\moren\appdata\local\programs\python\python37-32\python.exe: can't open file 'manage.py': [Errno 2] No such file or directory
if anyone can help me I would be very grateful
You need to cd into your project and run the command again, so in short the command python manage.py runserver
should be executed where the module "manage.py" is located.