How to run adev (aiohttp_devtools) command using PyCharm

I want to use the PyCharm debugger with aiohttp_devtools, but don't know how to execute the command:

adev runserver --no-livereload

      

in this window enter image description here

+3


source to share


2 answers


Thanks for raising the issue.

There is currently no easy way to do this.



The only solution is to create your own custom startup script that starts the server-to-server for example from aiohttp_devtools import cli; cli()

.

But I created an issue for your needs: https://github.com/aio-libs/aiohttp-devtools/issues/99

+1


source


I fixed the issue above, which is referenced by Andrew # 99, and will create a new version v0.5.0

, however this does not actually fix the problem. I'll explain how to debug work below.

I use pycharm, but I avoid debugging and similar features: partly because (as in this case) they are usually not worth the effort, and partly because of when someone comes up with a decent open source or paid IDE for python. I can get away from terrible creepiness and terrible customer service without too much hassle.

Thing to keep in mind when fighting pycharm was built by java developers in a hurry, not python developers; therefore it often differs significantly from the pythonic way of doing things.

For example, in this case, the developer has clearly not heard of a python -m

"launcher as script" or a virtualenv extension env/bin

to $PATH

. Instead of setting up debug, you need to add a new file to run the CLI and link to it in the debug setting:

adev.py

:



from aiohttp_devtools.cli import cli

if __name__ == '__main__':
    cli()

      

Then specify that to set up debugging:

pycharm debug

This worked great for me.

+2


source







All Articles