how to debug wsgi web app by pycharm

I am a newbie for python , and also a newbie user for pycharm

so currently I have a question about debug web app

from tutorials ,I know there is tutorial for diango and also gae,but for me I want to debug wsgi web app on local server , so how can I do it?

for example,

there are two python file

simpleapp.py


from wsgiref.util import setup_testing_defaults
from wsgiref.simple_server import make_server

# A relatively simple WSGI application. It's going to print out the
# environment dictionary after being updated by setup_testing_defaults
def simple_app(environ, start_response):
    setup_testing_defaults(environ)

    status = '200 OK'
    headers = [('Content-type', 'text/plain')]

    start_response(status, headers)

    ret = ["%s: %s\n" % (key, value)
           for key, value in environ.iteritems()]
    return ret

wsgiapp.py
httpd = make_server('', 8000, simple_app)
print "Serving on port 8000..."
httpd.serve_forever()
how do I add break point to simpleapp.py?
1 comment
Comment actions Permalink

Setting a break point is done in exactly the same way no matter what kind of project you need to debug: by clicking in the editor gutter (to the left of the text) orusing Run | Toggle Line Breakpoint (Ctrl-F8 in the default keymap).

0

Please sign in to leave a comment.