pythondjangowindowscommand-promptmanage.py

Django3 - manage.py commands stuck


I have a big problem wih Django3: basically, whenever I type a command for manage.py, the prompt gets stuck and never carries on the command without even crashing.

I tried several times the commands "runserver" and "startapp" and waited beetween 10 minutes and an hour, but I never managed to run the server or create an app because I launch the command and the prompt gets stuck.

Strangely enough, to test things out, I created a project, an app and run the server immediately after I installed Django3 and everything worked fine, I even have that project on github. Then I shut down the computer and now nothing works, except my test project.

Also, I noticed in the Windows resource monitor that whenever I try to lauch a command suddenly Python processes start to appear and disappear uncontrollably, and since I never had an issue like this I'm absolutely clueless about everything. So... What's happening? Did someone have the same problem?

I have the lastest Windows update, the latest Python3 (I got it via Windows Store) and the Latest Django3 (I got it via pip). I'd include a stacktrace or some sort of log but, since nothing crashes, I suppose no log gets done: if I'm wrong please correct me, please!

EDIT: I tried uninstalling and installing Python but the problem is the same: I created a test project and I successfully ran the server and started a new app. Once again, I shut down the computer and now everything is broken again.


Solution

  • Ok, thanks to ansuman I discovered virtual environments and now everything works again.

    If you're a noob like me and you want to know more go check the virtual environments documentation, it's extremely helpufl if you're experiencing (supposed) module conflicts like me. Also, it's such a cool feature: start using venv now, you won't regret it.

    Here's what I did step-by-step:

    Hope this help someone! Thanks again to ansuman.