473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

mod_python not working (showing source code)

Hello Everyone,

I have downloaded and installed mod_python and it doesn't seem to be
working. I am hoping someone can give me some pointers as to what I am doing
wrong. Here are the steps I've followed so far:

1. Installed mod_python from the rpm file.
2. Added LoadModule and AddModule directives to the httpd.conf file

Now, I have a file called mod_test.py that contains the following code:

#!/usr/bin/python

print "Test of mod_python"

When I call the file up in the browser, I simply see the python source. What
am I doing wrong?

Thanks!
Anthony
Jul 18 '05 #1
3 2400
"Anthony Papillion II" <pa*******@gmail.com> wrote:
Hello Everyone,

I have downloaded and installed mod_python and it doesn't seem to be
working. I am hoping someone can give me some pointers as to what I am doing
wrong. Here are the steps I've followed so far:

1. Installed mod_python from the rpm file.
2. Added LoadModule and AddModule directives to the httpd.conf file

Now, I have a file called mod_test.py that contains the following code:

#!/usr/bin/python

print "Test of mod_python"

When I call the file up in the browser, I simply see the python source. What
am I doing wrong?


What does your .htaccess look like? Did you do an AddHandler and
SetHandler so Apache knows what to do with your .py files, and set a
PythonHandler do mod_python knows what to do?

Did you actually read the mod_python documentation?
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 18 '05 #2
On Wed, 10 Nov 2004 19:32:21 -0600, "Anthony Papillion II"
<pa*******@gmail.com> wrote:
Hello Everyone,

I have downloaded and installed mod_python and it doesn't seem to be
working. I am hoping someone can give me some pointers as to what I am doing
wrong. Here are the steps I've followed so far:

1. Installed mod_python from the rpm file.
2. Added LoadModule and AddModule directives to the httpd.conf file

Now, I have a file called mod_test.py that contains the following code:

#!/usr/bin/python

print "Test of mod_python"

When I call the file up in the browser, I simply see the python source. What
am I doing wrong?

Thanks!
Anthony


in httpd.conf put someting like:

LoadModule python_module modules/mod_python.so

and in .htaccess:

SetHandler mod_python
AddHandler python-program .py
PythonHandler mod_python.publisher
#PythonHandler mptest
PythonDebug On

#PythonDebug On


Jul 18 '05 #3
Ivo Woltring <Py****@ivonet.nl> wrote:
On Wed, 10 Nov 2004 19:32:21 -0600, "Anthony Papillion II"
<pa*******@gmail.com> wrote:
Hello Everyone,

I have downloaded and installed mod_python and it doesn't seem to be
working. I am hoping someone can give me some pointers as to what I am doing
wrong. Here are the steps I've followed so far:

1. Installed mod_python from the rpm file.
2. Added LoadModule and AddModule directives to the httpd.conf file

Now, I have a file called mod_test.py that contains the following code:

#!/usr/bin/python

print "Test of mod_python"

When I call the file up in the browser, I simply see the python source. What
am I doing wrong?

Thanks!
Anthony


in httpd.conf put someting like:

LoadModule python_module modules/mod_python.so

and in .htaccess:

SetHandler mod_python
AddHandler python-program .py
PythonHandler mod_python.publisher
#PythonHandler mptest
PythonDebug On

#PythonDebug On

... change mod_test.py name to python-program.py ;-) Regards
Adam Przybyla
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Robert J. Hansen | last post by:
I'm not entirely certain comp.lang.python is the proper newsgroup for mod_python questions, but "comp.lang.python.web" doesn't seem to exist, so... my apologies in advance if this is considered...
1
by: neha | last post by:
hi, i m trying to integrate python with apache on linux.For this i m using mod_python. I dont see any problem with the versions of python,apache and mod_python i m using. the versions i m using...
2
by: m.banaouas | last post by:
I installed Apache 2.2.3 and mod_python 3.2.10 on WinXP plateform I configured mod_python via httpd.conf: LoadModule python_module modules/mod_python.so but my script folder configuration...
3
by: Michael | last post by:
Hey everyone, Is it possible to automatically insert headers/footers using mod_python? I will be not be using PSP's, so I cannot use the PSP/include solution. Furthermore, the header will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.