On Jun 8, 8:02 am, Francis <
fcr...@gmail.com> wrote:
> So I'm doing Start->Run and running cmd to get a command prompt, then
> I cd to the Google directory and i run:
>
> google_appengine\dev_appserver.py myappname
>
> The server starts no problem and works fine. The problem is, when I
> want to kill the server, I can't seem to find a way to do it other
> than a) closing the cmd window and starting another (uhh work) or b)
> opening the Task Manager and killing python.exe (also terrible).
What happens is that the Python process is blocked waiting for the
socket listen to complete: i.e. it is in Windows code, and Windows
doesn't usually check for Ctrl-C. Ctrl-Break will abort the Python
process immediately (without the usual cleanup that happens when a
Python process exits, but that probably doesn't matter here). The
alternative is to hit Ctrl-C and then go and request a page in your
browser: as soon as dev_appserver gets the request it is back in
Python code and the Ctrl-C will be handled as normal.
Fortunately you don't need to restart the server very often as it will
usually pick up changes to your code automatically. You could also
consider adding a shutdown button to your app (obviously you would
only display it when running on dev_appserver) and then you have a
quick way to terminate it from your browser.