pythondjangowindowspipmanage.py

Django, runserver issues (windows)


I've been looking for the solution everywhere. I tries to execute "python manage.py runserver" command, but all I received is an error: stack trace. I have a virtualenv activated, which is also visible at the screen. Also i did the "path" thing: path variables. I have lost so many time for this.

What else can i do?

I must note, that i am quite new in this world. Barely did my first "hello world" recently.

Edit1.

python3 didn't worked for me. it say "Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases."

after pip install django i've got

"Requirement already satisfied: django in c:\users\medion\appdata\local\programs\python\python39\lib\site-packages (3.1.5) Requirement already satisfied: sqlparse>=0.2.2 in c:\users\medion\appdata\local\programs\python\python39\lib\site-packages (from django) (0.4.1) Requirement already satisfied: pytz in c:\users\medion\appdata\local\programs\python\python39\lib\site-packages (from django) (2020.5) Requirement already satisfied: asgiref<4,>=3.2.10 in c:\users\medion\appdata\local\programs\python\python39\lib\site-packages (from django) (3.3.1)"

also thanks for so fast response


Solution

  • The problem is that you did not activate the virtual environment based on your "stack trace link". Why I think you got the error is that you have installed Django in virtual environment but are running the program in the system i.e outside the virtual environment. If you are using "VirtualEnv" for creating the virtual environment, navigate to the directory (folder) where the environment is and run Name_of_your_environment\Scripts\activate and then run python manage.py runserver