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

  • Home
  • SEARCH
  • 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 124253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:24:58+00:00 2026-05-11T04:24:58+00:00

I have a Bluehost account where I can run Python scripts as CGI. I

  • 0

I have a Bluehost account where I can run Python scripts as CGI. I guess it’s the simplest CGI, because to run I have to define the following in .htaccess:

Options +ExecCGI AddType text/html py AddHandler cgi-script .py 

Now, whenever I look up web programming with Python, I hear a lot about WSGI and how most frameworks use it. But I just don’t understand how it all fits together, especially when my web server is given (Apache running at a host’s machine) and not something I can really play with (except defining .htaccess commands).

How are WSGI, CGI, and the frameworks all connected? What do I need to know, install, and do if I want to run a web framework (say web.py or CherryPy) on my basic CGI configuration? How to install WSGI support?

  • 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. 2026-05-11T04:24:59+00:00Added an answer on May 11, 2026 at 4:24 am

    How WSGI, CGI, and the frameworks are all connected?

    Apache listens on port 80. It gets an HTTP request. It parses the request to find a way to respond. Apache has a LOT of choices for responding. One way to respond is to use CGI to run a script. Another way to respond is to simply serve a file.

    In the case of CGI, Apache prepares an environment and invokes the script through the CGI protocol. This is a standard Unix Fork/Exec situation — the CGI subprocess inherits an OS environment including the socket and stdout. The CGI subprocess writes a response, which goes back to Apache; Apache sends this response to the browser.

    CGI is primitive and annoying. Mostly because it forks a subprocess for every request, and subprocess must exit or close stdout and stderr to signify end of response.

    WSGI is an interface that is based on the CGI design pattern. It is not necessarily CGI — it does not have to fork a subprocess for each request. It can be CGI, but it doesn’t have to be.

    WSGI adds to the CGI design pattern in several important ways. It parses the HTTP Request Headers for you and adds these to the environment. It supplies any POST-oriented input as a file-like object in the environment. It also provides you a function that will formulate the response, saving you from a lot of formatting details.

    What do I need to know / install / do if I want to run a web framework (say web.py or cherrypy) on my basic CGI configuration?

    Recall that forking a subprocess is expensive. There are two ways to work around this.

    1. Embedded mod_wsgi or mod_python embeds Python inside Apache; no process is forked. Apache runs the Django application directly.

    2. Daemon mod_wsgi or mod_fastcgi allows Apache to interact with a separate daemon (or ‘long-running process’), using the WSGI protocol. You start your long-running Django process, then you configure Apache’s mod_fastcgi to communicate with this process.

    Note that mod_wsgi can work in either mode: embedded or daemon.

    When you read up on mod_fastcgi, you’ll see that Django uses flup to create a WSGI-compatible interface from the information provided by mod_fastcgi. The pipeline works like this.

    Apache -> mod_fastcgi -> FLUP (via FastCGI protocol) -> Django (via WSGI protocol) 

    Django has several ‘django.core.handlers’ for the various interfaces.

    For mod_fastcgi, Django provides a manage.py runfcgi that integrates FLUP and the handler.

    For mod_wsgi, there’s a core handler for this.

    How to install WSGI support?

    Follow these instructions.

    https://code.google.com/archive/p/modwsgi/wikis/IntegrationWithDjango.wiki

    For background see this

    http://docs.djangoproject.com/en/dev/howto/deployment/#howto-deployment-index

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 142k
  • Answers 142k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There is actually an undocumented hack: decorate the class with… May 12, 2026 at 8:21 am
  • Editorial Team
    Editorial Team added an answer If you have never checked out Selenium, then you need… May 12, 2026 at 8:21 am
  • Editorial Team
    Editorial Team added an answer Your question's a little confusing but I'll try it out.… May 12, 2026 at 8:21 am

Related Questions

I'm in the process of developing my first major project. It's a light-weight content
I am trying to move my Joomla1 website from localhost to my bluehost.com domain.
Error: Database table users for model User was not found. I'm expriencing the error
We have a website made by Django. And there is no problem when access

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.