Django python has stopped working when trying to run server after closing it once

2
python manage.py runserver

works fine the first time, but after closing it with ctrl+c, I can't start it up again. I get the error message "Python has stopped working".

This is easily fixed by restarting my computer but it is very inconvenient.

I have also tried the same thing using pycharm, but i get the error message:

Process finished with exit code -1073741819 (0xC0000005)

I am currently on Windows 10.

python
django
pycharm
asked on Stack Overflow Feb 8, 2017 by longtth

2 Answers

3

This happens to me and I'm not using Pycharm. I'm using Powershell, Python 3.6 and Django 1.10

If you do

python manage.py runserver --noreload

then it works.

This was reported but as it's not clear if it's related to Powershell or Django, the report is not allowed to be open. https://code.djangoproject.com/ticket/27766

answered on Stack Overflow Mar 19, 2017 by user3599526 • edited Mar 19, 2017 by user3599526
0

First step was to set the environment variable.

  1. windows key + pause or Control Panel\System and Security\System
  2. Advance system settings (this will open system property)
  3. navigate to Advanced tab > Environment variable
  4. Edit path - append c:\python36 in variable value field
  5. Change 'c:\python36' to ';c:\python36'

then /python manage.py runserver should work

I have no idea why but it worked for me.

answered on Stack Overflow Feb 10, 2017 by Filip

User contributions licensed under CC BY-SA 3.0