how to configure hug application in PyCharm
Hi, I am new to python and I have tried to configure my hug application to use PyCharm for debugging, however I have not been able to determine the startup script that work with PyCharm .

Unfortunately with the way hug code is run (hug -f FILE) you have to attach the debugger to the process (Unless some other undocumented way exists), first step would be making the run process more convenient, I suggest creating a new External Tool preset like this:
Makes it a bit simpler to get running, once its running you would then use the Run > Attach to local process feature. Keep in mind it apparently only works for Python 3.4.4 and older.
Thanks,
On Feb 22, 2017 9:20 AM, "Anthony Forsberg" [email protected] wrote:
Unfortunately with the way hug code is run (hug -f FILE) you have to attach the debugger to the process, first step would be making the run process more convenient, I suggest creating a new External Tool preset like this: [image: hug] https://cloud.githubusercontent.com/assets/1984403/23215308/e29d8a66-f8df-11e6-9a9b-0bbeb33970f7.PNG
Makes it a bit simpler to get running, once its running you would then use the Run > Attach to local process feature. Keep in mind it apparently only works for Python 3.4.4 and older.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/timothycrosley/hug/issues/460#issuecomment-281681689, or mute the thread https://github.com/notifications/unsubscribe-auth/ALRjVfY3ib03lSXIeqNy4C7BQLi_GOycks5rfEQVgaJpZM4MHgIO .
If it helps, this alternative approach also seems to behave like any other wsgi server for PyCharm, and happily handles debugging, code coverage etc. Setup is as simple as pointing PyCharm at this server. Can vouch for it on Python 3.5, 3.6: https://github.com/timothycrosley/hug/issues/450#issuecomment-279685321
Closing this as it seems to have been satisfactorily answered. Thanks! ~Timothy
@davidhyman "Setup is as simple as pointing PyCharm at this server."
How do you do this? If the comment you've linked to is related, I'm not following it.
FWIW here's what I ended up doing to run/debug from PyCharm. api is a file with hug routes defined.
from werkzeug.serving import run_simple
import api
def create_app():
return api.__hug_wsgi__
app = create_app()
if __name__ == '__main__':
run_simple('0.0.0.0', 5000, app, use_reloader=True, use_debugger=True, threaded=True)