0

python version: 3.7.4

django version: 2.2.7

os: windows 10

Trying to execute manage.py in any way, shape, or form is not working from neither vscode's python interface, cmd, nor windows powershell. It doesn't show any errors or anything happening. It was working as recently as one week ago the last time I tried. This is how my windows look:

vscode:

'C:\Users\josep\Documents\GitHub\lang_site>py manage.py runserver'

'C:\Users\josep\Documents\GitHub\lang_site>'

cmd:

'C:\Users\josep\Documents\GitHub\lang_site>py manage.py runserver'

'C:\Users\josep\Documents\GitHub\lang_site>`

I have tried the following from the directory containing manage.py:

  • check my Path environment variable contains C:\Users referencing this post
  • uninstall/reinstall Django via pip
  • restart my machine
  • check my init files referencing this post
  • check if I have changed my manage.py file in any way by mistake
  • go to a previous working branch that I haven't touched in a long time
  • try django-admin runserver --settings=lang_site.settings
    • result is ModuleNotFoundError: No module named 'lang_site'
    • I also double checked to make sure the lang_site folder contains a proper __init__.py
  • I have tried py manage.py + runserver, help, and by itself but none of them are executing
  • start a new, fresh django project and try manage.py from there
    • this must mean it's problem with my pc settings, right?

Just to doublecheck, there is my manage.py:

#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys


def main():
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lang_site.settings')
    try:
        from django.core.management import execute_from_command_line
    except ImportError as exc:
        raise ImportError(
            "Couldn't import Django. Are you sure it's installed and "
            "available on your PYTHONPATH environment variable? Did you "
            "forget to activate a virtual environment?"
        ) from exc
    execute_from_command_line(sys.argv)


if __name__ == '__main__':
    main()

~Link to my directory structure.

I expect the test surver to be launched but nothing is executing for some reason. I have tried every troubleshooting tip I could find but nothing seems to be working. I would appreciate any help.

Joseph Rajchwald
  • 487
  • 5
  • 13

0 Answers0