Python
  Home arrow Python arrow A Brief Look at Mod_Python
CIO Insight
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PYTHON

A Brief Look at Mod_Python
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 19
    2005-04-25

    Table of Contents:
  • A Brief Look at Mod_Python
  • Installing Mod_Python
  • Getting Started
  • Creating Handlers and Working with the API
  • Python Server Pages

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    FaxWave - Free Trial.
     
    ADVERTISEMENT

    Ziff Davis Enterprise Virtual Tradeshows: Hot Topics, Cutting Edge Technology, Real-time Interaction with IT Professionals. Learn more at ziffdavisvts.com

    A Brief Look at Mod_Python
    (Page 1 of 5 )

    Python's Apache interpreter is available as an Apache module, mod_python. This module reduces the time it takes to deliver a given page to a client. It is also capable of a great deal more, including interacting with Apache itself in various powerful ways. This article gives you just a taste of what mod_python can do.

    Introduction

    You enter in an address, requesting a page from Apache. It's not just any old page, though. It's a CGI script written in Python. A few moments later, you're staring at the results. However, what exactly does Apache do with your request? As with all CGI scripts, Apache spawns a new process - in this case, the Python interpreter - and then spits out that process' output. It works, but it isn't the fastest way, nor is it the most efficient way.

    Other languages have presented different solutions to this problem. Languages such as PHP have embedded their interpreters into Apache. Other languages, such as Perl, offer Apache modules (in Perl's case, mod_perl) that do this. These "other languages" include Python, though not enough people realize this.

    This article deals with Python's own module for Apache, mod_python, and the benefits it provides to both man and machine.

    A Quick Look at Mod_Python

    As I stated eariler, mod_python embeds the Python interpreter into Apache. This reduces the time needed to deliver a given page to a client. Starting the Python interpreter, waiting for it to finish executing, and then catching its output not only takes time, but it takes up valuable resources as well.

    This, however, is not the only benefit provided by mod_python. Mod_python can interact with Apache, giving you extraordinary power. You can change the way Apache handles tasks and utilize the Apache API.

    Languages that can be embedded straight into HTML, such as PHP, are very popular. CGI does not allow this. However, mod_python does. You've seen Java Server Pages (JSP) and Active Server Pages (ASP); this article will introduce you to Python Server Pages (PSP).

    Interesting? Yes. Let's move on.

    More Python Articles
    More By Peyton McCullough


       · Python source examples are wrongly formatted and so syntactically incorrect. Please...
       · The examples won't work, since the indentation has been lost. Hopefully the author...
       · We have changed the code samples to the proper indentation that the author provided....
       · I installed mod_python in my apache server but apache is not starting now. When I...
       · Nice Intro - thanx!The following example needed a <html> tag, due to Mime...
     

       

    PYTHON ARTICLES

    - SSH with Twisted
    - Mobile Programming in Python using PyS60: UI...
    - Python: Count on It
    - Python Strings: Spinning Yarns
    - Python: More Fun with Strings
    - Python: Stringing You Along
    - Python Operators
    - Bluetooth Programming in Python: Network Pro...
    - Python Sets
    - Python Conditionals, Lists, Dictionaries, an...
    - Python: Input and Variables
    - Introduction to Python Programming
    - Mobile Programming in Python using PyS60: Ge...
    - Bluetooth Programming using Python
    - Finishing the PyMailGUI Client: User Help To...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway