Python
  Home arrow Python arrow Karrigell for Python
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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

Karrigell for Python
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 12
    2006-01-03


    Table of Contents:
  • Karrigell for Python
  • Scripts and Services
  • Being HIP
  • A Few More Features

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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

     
     
    ADVERTISEMENT


    Karrigell for Python
    ( Page 1 of 4 )

    Since Python is not specifically designed for web development, a number of technologies created by Python users exist that aim to provide a web development environment. While the exact approach to the situation varies among each framework, a few of these frameworks really stand out in the crowd. One such framework is Karrigell. Read on to learn more.

    Introduction

    While Karrigell is very powerful and flexible, offering multiple solutions to web development, it is surprisingly simple to set up and work with. Python novices won't find any obstacles when working with Karrigell, and Python experts won't feel too limited. It offers its own web server that gets the job done, but it also can be easily integrated with technologies such as Apache, so you do not have to sacrifice the use of other technologies when choosing Karrigell.

    This article will guide you through the installation of Karrigell and will explore some of the capabilities of the web framework.

    Installing Karrigell

    Fortunately, there really isn't any complicated magic involved with the installation of Karrigell. The obvious first step is to obtain the web framework, available at SourceForge:

    http://sourceforge.net/projects/karrigell

    Once you've downloaded Karrigell, extract it to an easily accessible directory, such as . Next, then simply execute Karrigell.py to start the built-in server. If you only want to run the included server and not set up Karrigell to work with another web server, your work is done, and you may safely skip to the next section.

    Otherwise, you'll need to configure your web server to interact with Karrigell. We'll take a look at Apache. We'll need the Karrigell web server to run behind Apache, so that Apache can pass off the relevant requests to Karrigell.

    Since Apache will likely be running on port 80, you will need to set the Karrigell server on another port. You can either do this through the command line or by editing Karrigell's configuration file. We'll use port 8080 for Karrigell. The first method works something like this:

    C:\Karrigell>Karrigell.py -P 8080

    To change Karrigell's configuration file to set a default port, simply add this to Karrigell.ini:

    port=8080

    Now we have to configure Apache to redirect requests for Karrigell. Likely, you will want Apache to deal with all the static files of your website, along with other technologies such as PHP. To do this, you can create identical directory structures in both Karrigell and Apache – or at least for the directors where you want to utilize Karrigell – and configure Apache to redirect requests to Karrigell-associated files to the Karrigell server. All you need to do to set this up is add these lines to Apache's httpd.conf file:

    RewriteEngine On
    RewriteRule ^/(.*).py(.*) http://localhost:8080/$1.py$2 [L,P]
    RewriteRule ^/(.*).ks(.*) http://localhost:8080/$1.ks$2 [L,P]
    RewriteRule ^/(.*).hip(.*) http://localhost:8080/$1.hip$2 [L,P]
    RewriteRule ^/(.*).pih(.*) http://localhost:8080/$1.pih$2 [P]

    If you want to, you can also set Apache to redirect all of the particular files in a directory to Karrigell. We'll be using a directory called testarea throughout this article, so to configure Apache to redirect all requests to a file within that directory to Karrigell, add this to httpd.conf:

    RewriteEngine On
    RewriteRule ^/testarea(.*) http://localhost:8080/testarea$1 [P]

    You could also modify the first set of configuration directives so that they only apply to a certain directory:

    RewriteEngine On
    RewriteRule ^/testarea/(.*).py(.*)
    http://localhost:8080/testarea/$1.py$2 [L,P]
    RewriteRule ^/testarea/(.*).ks(.*)
    http://localhost:8080/testarea/$1.ks$2 [L,P]
    RewriteRule ^/testarea/(.*).hip(.*)
    http://localhost:8080/testarea/$1.hip$2 [L,P]
    RewriteRule ^/testarea/(.*).pih(.*)
    http://localhost:8080/testarea/$1.pih$2 [P]



     
     
    >>> More Python Articles          >>> More By Peyton McCullough
     

       

    PYTHON ARTICLES

    - Tuples and Other Python Object Types
    - The Dictionary Python Object Type
    - String and List Python Object Types
    - Introducing Python Object Types
    - Mobile Programming using PyS60: Advanced UI ...
    - Nested Functions in Python
    - Python Parameters, Functions and Arguments
    - Python Statements and Functions
    - Statements and Iterators in Python
    - Sequences and Sets in Python
    - Python Expressions and Operators
    - Dictionaries, Variables and Statements in Py...
    - Data Types in Python
    - The Python Language
    - SSH with Twisted





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT