Django /manage.py runserver doesn't work (Windows)
Question:
I have installed python 2.7.10 in windows. I installed django in path c:python27/scripts/
with a command pip install django
and created project with command django-admin startproject mysite
from the same path.
Now to run server i cd to path c:python27/scripts/mysite
and ran a command manage.py runserver
/ manage.py runserver 0.0.0.0:8000
And this has no any effect.
where did i go wrong, and also i couldn’t run with python console. and i couldn’t redirect to my project from python CMD. all i did is from windows console.
Answers:
First step was to set the environment variable.
windows key
+ pause
or Control PanelSystem and SecuritySystem
- Advance system settings (this will open system property)
- navigate to
Advanced tab
> Environment variable
- Edit path – append
;c:python27
in variable value field
- Restart CMD
then /python manage.py runserver
should work
Trying setting up a virtualenv for your project.
This same issue happened to me when trying to launch the test server
python .manage.py runserver
from PowerShell on Windows 10. According to the Django site, there might be an issue with the type of arguments being passed from PowerShell.
My workaround was to use a virtualenv. Once that was setup with django installed via pip, the runserver command worked.
After setting C:Python
in the environment variables, issuing the following command helped:
py manage.py runserver
had the same problem. fixed it by checking python and django version compatibility. If you’re still battling with this update one or the other or ensure they’re both compatible with each other in the virtual’env’ you’re setting up.
good luck.
Try this fix guys:
1. Right click on the windows icon/start on the bottom left and run Windows Powershell as admin.
2. Than type cd ~/
and later change the path again to the project folder.
3. type python manage.py runserver
and press enter.
The best solution is to install Python from Microsoft Store. In this case, you won’t have to worry about the Environmental Variables and Path. Windows will detect all that automatically.
When you open the command prompt on windows, the default directory might be C:WINDOWSSystem32>
Here, you have to change the directory by just adding cd to the default directory. Then copy the directory of where your project is and paste with one space. So it will be:
C:yourfolderyourproject>
Next, use the comman which is, python manage.py runserver
That’s all
I have installed python 2.7.10 in windows. I installed django in path c:python27/scripts/
with a command pip install django
and created project with command django-admin startproject mysite
from the same path.
Now to run server i cd to path c:python27/scripts/mysite
and ran a command manage.py runserver
/ manage.py runserver 0.0.0.0:8000
And this has no any effect.
where did i go wrong, and also i couldn’t run with python console. and i couldn’t redirect to my project from python CMD. all i did is from windows console.
First step was to set the environment variable.
windows key
+pause
orControl PanelSystem and SecuritySystem
- Advance system settings (this will open system property)
- navigate to
Advanced tab
>Environment variable
- Edit path – append
;c:python27
in variable value field - Restart CMD
then /python manage.py runserver
should work
Trying setting up a virtualenv for your project.
This same issue happened to me when trying to launch the test server
python .manage.py runserver
from PowerShell on Windows 10. According to the Django site, there might be an issue with the type of arguments being passed from PowerShell.
My workaround was to use a virtualenv. Once that was setup with django installed via pip, the runserver command worked.
After setting C:Python
in the environment variables, issuing the following command helped:
py manage.py runserver
had the same problem. fixed it by checking python and django version compatibility. If you’re still battling with this update one or the other or ensure they’re both compatible with each other in the virtual’env’ you’re setting up.
good luck.
Try this fix guys:
1. Right click on the windows icon/start on the bottom left and run Windows Powershell as admin.
2. Than type cd ~/
and later change the path again to the project folder.
3. type python manage.py runserver
and press enter.
The best solution is to install Python from Microsoft Store. In this case, you won’t have to worry about the Environmental Variables and Path. Windows will detect all that automatically.
When you open the command prompt on windows, the default directory might be C:WINDOWSSystem32>
Here, you have to change the directory by just adding cd to the default directory. Then copy the directory of where your project is and paste with one space. So it will be:
C:yourfolderyourproject>
Next, use the comman which is, python manage.py runserver
That’s all