How To Use Gunicorn With Swagger_server On Flask
I'm trying to start the swagger server using gunicorn on ec2 instance by using the following code: I tried : gunicorn -w 4 -b 0.0.0.0:8080 -p pidfile -D swagger_server:app and thi
Solution 1:
What you are trying to do is equivalent to:
from swagger_server.__main__ import main
For this to work with gunicorn, try:
gunicorn "swagger_server.__main__:main" -w 4 -b 0.0.0.0:8080`
In case you have the error:
ImportError: No module named swagger_server
add the PYTHONPATH to gunicorn command:
gunicorn "swagger_server.__main__:main" -w 4 -b 0.0.0.0:8080--pythonpath path_to_swagger_server
Solution 2:
gunicorn -b0.0.0.0:8080 main:app --reload
This should be the correct syntax, obviously make sure you're in the correct directory and source your virtualenv.
Solution 3:
isn't your application looking for a configuration file with a section like [app:main]?
Solution 4:
This one worked for me:
gunicorn "swagger_server.__main__:app" -w 4 -b 0.0.0.0:8080
Post a Comment for "How To Use Gunicorn With Swagger_server On Flask"