Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8930761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:58:05+00:00 2026-06-15T08:58:05+00:00

My question is basically what’s in the title: how can I setup gunicorn to

  • 0

My question is basically what’s in the title: how can I setup gunicorn to run a web.py app? (Also, if there are any differences, how would I do it on heroku?)

I already have my app running on heroku using the built in cherrypy, but I have not been able to get gunicorn to work with web.py (I just have no idea where to start – I couldn’t find any tutorials).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:58:06+00:00Added an answer on June 15, 2026 at 8:58 am

    I’m afraid I’m not familar with Heroku, but I can answer your basic question.

    gunicorn is a HTTP server for running Python web apps via WSGI. web.py is a framework for creating Python web apps using WSGI.

    So you don’t really need a tutorial for using both together, as all you need to do is figure out how to pass the WSGI entry point of your web.py application to gunicorn. A WSGI application is just a Python callable with the right interface i.e. it takes certain parameters and returns a certain response. See this WSGI tutorial for more.

    The “hello world” application from the web.py tutorial looks like this test.py:

    import web
    
    urls = (
        '/', 'index'
    )
    
    class index:
        def GET(self):
            return "Hello, world!"
    
    if __name__ == "__main__":
        app = web.application(urls, globals())
        app.run()
    

    But that does not expose the WSGI application which gunicorn needs.

    web.py provides a WSGI application via the wsgifunc method of web.application. We can add this to test.py by adding the following after the index class:

    # For serving using any wsgi server
    wsgi_app = web.application(urls, globals()).wsgifunc()
    

    This is basically what the web.py documentation tells you to do in the deployment section, when using Apache + mod_wsgi – the fact that the Python code is the same for us with gunicorn is not a coincidence because this is exactly what WSGI gives you – a standard way to write the Python so that it can be deployed using any WSGI capable server.

    As explained in the gunicorn docs, we can then point gunicorn at the wsgi_app member of the test module as follows:

    (tmp)day@office:~/tmp$ gunicorn test:wsgi_app
    2012-12-03 23:31:11 [19265] [INFO] Starting gunicorn 0.16.1
    2012-12-03 23:31:11 [19265] [INFO] Listening at: http://127.0.0.1:8000 (19265)
    2012-12-03 23:31:11 [19265] [INFO] Using worker: sync
    2012-12-03 23:31:11 [19268] [INFO] Booting worker with pid: 19268
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically the question is how do I run gpgpu code in a Metro app.
Well the subject is the question basically. Are there any version control systems out
Question basically as in the title. I could use c/c++/objective-c. I would like to
SHORT VERSION OF QUESTION: So basically my question is: How can I set the
I can provide more detail if necessary, but my question is basically thus: If
The question is basically contained in the title. Say you have an application that
the question comes basically down to this: how can i securely create new databases
Another newbie (Common) LISP question: Basically in most programming languages there's a mean for
I'm not really sure how to title this question but basically I have an
Today I stumbled upon this thread: http://www.mathworks.com/matlabcentral/newsreader/view_thread/112560 The question is basically how to make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.