Nothing happens when I do: python manage.py command

前端 未结 11 520
半阙折子戏
半阙折子戏 2020-12-07 02:50

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

相关标签:
11条回答
  • 2020-12-07 02:57

    My solution is to modify python in "Uninstall and change program" and check on "add to path" option. then restart powershell \ cmd.

    0 讨论(0)
  • 2020-12-07 03:02

    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
    
    0 讨论(0)
  • 2020-12-07 03:07

    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.

    0 讨论(0)
  • 2020-12-07 03:07

    If Anything not works I have a solution please try this.

    1. Uninstall Python.
    2. Go inside C drive and search Django. You will get many Django related files.
    3. Delete every Django file.
    0 讨论(0)
  • 2020-12-07 03:09

    On Ubuntu works for my by running manage.py as script:

    ./manage.py runserver
    
    0 讨论(0)
  • 2020-12-07 03:15

    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.

    0 讨论(0)
提交回复
热议问题