FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Python....





Erik23a86
I was wondering how many people use Python for there website. Because i really like Python and there advantages over, for example Perl, it seems that it isn't widely used.
So, how is using python for there website and what kind of modules/functionality do you use Python for? (I like examples Razz)

Erik
jabapyth
I love python!! (and it's getting more widely used)
You can use the cgi module, or (where it's supported) mod_python

Here's cgi
Code:
#! /usr/local/bin/python
#
print "Content-type: text/html\n"
print "Hello Cgi"



Mod python is a little more complicated
first, create a python directory (I use mysite.com/py)
This is the .htaccess ( in your python directory )
Code:
AddHandler python-program .py
PythonHandler mod_python.publisher
PythonDebug On


here is test.py
Code:
def hello(req):
    ## do whatever you want here
    return "Hello, World" ## return the page html

This is accessed as http://yoursite.com/py/test/hello
Erik23a86
What is mod_python exactly and why use it? I've read that it is much faster than using the cgi module. Is this true and how much faster is it than? And are there more advantage in using mod_python instead of the cgi module?
d3f3nd3r
if you want to programm websites with python you may use the django framework

www.djangoproject.org
jabapyth
Erik23a86 wrote:
What is mod_python exactly and why use it? I've read that it is much faster than using the cgi module. Is this true and how much faster is it than? And are there more advantage in using mod_python instead of the cgi module?


Mod python is "With mod_python you can write web-based applications in Python that will run many times faster than traditional CGI and will have access to advanced features such as ability to retain database connections and other data between hits and access to Apache internals." (modpython.org)

A great article about it is here

CGI works fine for me (on my main site, mod_python isn't supported), but here on frihost, they do have mod_python, so I suggest you use it.
yoohoo
what version of python is supported here? can i use all the new features of python 2.5?
rohan2kool
i'm not sure if which version frihost has, but i think its is Python 2.2.
patriot
use zope
Related topics
Monty Python
Python Tutorial
Python
python tutorials
python tutorials
Python books
Python Bursts After Trying to Eat Gator
python support
python
pls suggest software to generate thumbnails etc...
Unix Python Code Execution
Python
Python(cont)
Does frihost still support Python for CGI programming
Kentucky Man Finds Python in Rental Car
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.