Search code examples
pythonpycharmaiohttp

How do I use aiohttp-devtools with the PyCharm debugger?


I'm working on a team where we're using aiohttp-devtools to run a local server on our computers while developing a website.

I'm now in a situation where I'd like to use the PyCharm debugger, but it isn't working (I'm setting breakpoints, but the code isn't stopping at those breakpoints).

I came across this SO issue but I'm not sure it applies to my situation.

Here's what my run configuration looks like: enter image description here


Solution

  • The answer ended up being to use the solution posted in the Stack Overflow question I linked to in my question:

    Create a new file with the code below and have PyCharm run that file in debug mode:

    from aiohttp_devtools.cli import cli
    
    if __name__ == '__main__':
        cli()