On 01/22/2014 07:59 PM, Thomas Grzybowski wrote:
Hi!
I am trying to serve a trivial pyramid app using gunicorn in the most
basic way. The application.py is as follows:
from pyramid.config import Configurator
from pyramid.response import Response
# This acts as the view function
def hello_world(request):
return Response("hello world!")
def app():
# Grab the config, add a view, and make a WSGI app
config = Configurator()
config.add_view(hello_world)
app = config.make_wsgi_app()
return app
I'd guess instead of the above:
from pyramid.config import Configurator
from pyramid.response import Response
# This acts as the view function
def hello_world(request):
return Response("hello world!")
config = Configurator()
config.add_view(hello_world)
app = config.make_wsgi_app()
I try to serve this application as so:
$gunicorn -w 1 --log-file=gunicorn.log application:app
This is the result from my gunicorn.log file:
2014-01-22 19:30:14 [5000] [ERROR] Error handling request
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/gunicorn/workers/sync.py", line
99, in handle_request
respiter = self.wsgi(environ, resp.start_response)
TypeError: app() takes no arguments (2 given)
I see that gunicorn is looking for two arguments in the app. How do I
make this WSGI plumbing work?
thanks much!
Tom Grzybowski
--
You received this message because you are subscribed to the Google
Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.