I\'m new to django and currently going through the main tutorial. Even though it was working earlier, when I do python manage.py runserver OR python manage.py -h OR with any
My solution is to modify python in "Uninstall and change program" and check on "add to path" option. then restart powershell \ cmd.
if you created a virtual environment then activate it. you can try this command(in virtual environment directory) if you're using windows os:
.\Scripts\activate
If you had your server running till one point and a certain action/change broke it, try going back to the previous state.
In my case there was an email trigger which would put the system in an invalid state if email doesn't go through. Doing git stash
followed by selectively popping the stash and trying the runserver
helps narrow down the problem to a particular file in your project.
If Anything not works I have a solution please try this.
On Ubuntu works for my by running manage.py
as script:
./manage.py runserver
The problem is that the first line in manage.py
breaks the file on windows.
The first line should look like this:
#!/usr/bin/env python
Removing it will fix the issue.