The question can be devided on two separate parts.
I have the following project stucture
|- project | |-- app/ - directory with actual project code | |-- app.py - imports something from app/ and call create_appWhen I run
gunicornI should point him toappobject which is actually created inapp.py. So I get an error because gunicorn treatsapp:appas a package. The only way is to rename something?I use factory method to create app. So I import
create_appfuction in app.py and pass it toManagerfromflask.ext.script. I pass manager object to gunicorn. In this case gunicorn runs correctly but once the first request comes I get the following error:[2015-03-25 15:38:11 +0000] [14395] [ERROR] Error handling request Traceback (most recent call last): File "/opt/env/local/lib/python2.7/site-packages/gunicorn/workers/async.py", line 52, in handle self.handle_request(listener_name, req, client, addr) File "/opt/env/local/lib/python2.7/site-packages/gunicorn/workers/ggevent.py", line 159, in handle_request super(GeventWorker, self).handle_request(*args) File "/opt/env/local/lib/python2.7/site-packages/gunicorn/workers/async.py", line 105, in handle_request respiter = self.wsgi(environ, resp.start_response) TypeError: __call__() takes at most 2 arguments (3 given)Perhaps I could create some file
wsgi.pyand provide current app for gunicorn ?