Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Environment set up for running a falcon app

I've a simple falcon app which I'm running on the terminal using the following command,

gunicorn -b 0.0.0.0:5000 main:app --reload

main.py is the python file which instantiates app = falcon.API(). This works.

So I tried to set this config inside of PyCharm. But this I can't get to run. Here's the PyCharm config window

enter image description here

Can someone help me configure this window to get the app running.

like image 271
Melissa Stewart Avatar asked Nov 23 '17 23:11

Melissa Stewart


People also ask

What are Falcon Resources Python?

Falcon is a blazing fast, minimalist Python web API framework for building robust app backends and microservices. The framework works great with both asyncio (ASGI) and gevent/meinheld (WSGI).


Video Answer


1 Answers

Looks like you almost got it right already, except you need to set the script to the gunicorn of your virtual environment, and put the parameters in the appropriate input box.

Use the "three dots" button to the right of the script input box, and navigate to the virtual environment, there you should find a bin/ directory, inside there should be gunicorn. Selecting this should have you end up with your input box like this:

/path/to/virtualenv/bin/gunicorn

No parameters, these go into the script parameters input box below like this:

-b 0.0.0.0:5000 main:app

In the input box working directory, you set it to the working directory of your app, like this:

/path/to/appdirectory

It is possible that you need to enable gevent compatible for the debugger, which you can set in File > Settings > Build, Execution, Deployment > Python Debugger with a checkbox.

like image 141
bgse Avatar answered Nov 15 '22 23:11

bgse