Terminating Flask's Internal Server in Eclipse ( Aptana Pydev)

帅比萌擦擦* 提交于 2019-12-11 18:04:10

问题


I am using Aptana plugin in eclipse Luna. Pydev is already there in Aptana.

I am doing flask development using flask's internal web server (Werkzeug/0.10.1 Python/2.7.6).

When i run my project everything goes well but when i terminate run, my app server remain active.

It keeps serving and when i run my project again it gives me following socket error.

socket.error: [Errno 98] Address already in use

Previously i was using pydev without aptana and it was working fine. Now for every run i am killing process manually which is very annoying.

I am using ubuntu and virtualenv.

How can i overcome this issue ?

Thanks


回答1:


I found solution after reading this thread.

Trick is while running your application pass use_reloader=False.

    app.run("0.0.0.0", 5051, debug=True, use_reloader=False)


来源:https://stackoverflow.com/questions/29430718/terminating-flasks-internal-server-in-eclipse-aptana-pydev

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!