[Python] when i try to use "django-admin runserver" on a project that worked about a month ago...

Discussão em 'Python' iniciado por Stack, Setembro 25, 2024.

  1. Stack

    Stack Membro Participativo

    PS F:\filenaem\djangler> django-admin runserver
    Traceback (most recent call last):
    File "<frozen runpy>", line 198, in _run_module_as_main
    File "<frozen runpy>", line 88, in _run_code
    File "C:\Users\user\AppData\Local\Programs\Python\Python312\Scripts\django-admin.exe\__main__.py", line 7, in <module>
    File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
    utility.execute()
    File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\core\management\__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\core\management\base.py", line 413, in run_from_argv
    self.execute(*args, **cmd_options)
    File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\core\management\commands\runserver.py", line 75, in execute
    super().execute(*args, **options)
    File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\core\management\base.py", line 459, in execute
    output = self.handle(*args, **options)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\core\management\commands\runserver.py", line 82, in handle
    if not settings.DEBUG and not settings.ALLOWED_HOSTS:
    ^^^^^^^^^^^^^^
    File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\conf\__init__.py", line 81, in __getattr__
    self._setup(name)
    File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\conf\__init__.py", line 61, 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.


    tried to use the django-admin runserver command and expected it to work, because its a finished project that i made with the assistance of my old teacher, but for whatever reason when i try to run it now 2 months later and after moving it to another computer via an external disk it doesnt work, any help?

    also "python manage.py runserver" doesnt work eighter, it just gives me this:

    PS F:\filenaem\djangler> python manage.py runserver
    C:\Users\user\AppData\Local\Programs\Python\Python312\python.exe: can't open file 'F:\\filenaem\\djangler\\manage.py': [Errno 2] No such file or directory

    Continue reading...

Compartilhe esta Página