473,698 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with Python Server Pages (PSP)

Hi,

I am facing a very basic problem with PSP. I have installed mod_python
(in fedora Core 1), added the lines required for loading Python
modules and handling PSP pages. I have created a hello.psp page. But
when I try to view this hello.psp page, all Python code are getting
displayed.

The said page is stored at /var/www/html/psp/hello.psp. I guess this
is some configuration problem with Apache, but not able to figure out
the exact problem. I have tried putting those configuration lines for
psp in both httpd.conf and python.conf files. But still it is not
working.

The Python module (mod_python) is getting loaded. Because when I
telnet to my server, I can find that in the headers.

These are the versions of the softwares:
Apache: 2.0.47
Python: 2.2.3
mod_python: 3.0.3

Thnaks for all your suggestions.
Jul 21 '08 #1
6 1616
On Jul 21, 9:42*pm, barun.sah...@gm ail.com wrote:
Hi,

I am facing a very basic problem with PSP. I have installedmod_py thon
(in fedora Core 1), added the lines required for loading Python
modules and handling PSP pages. I have created a hello.psp page. But
when I try to view this hello.psp page, all Python code are getting
displayed.

The said page is stored at /var/www/html/psp/hello.psp. I guess this
is some configuration problem with Apache, but not able to figure out
the exact problem. I have tried putting those configuration lines for
psp in both httpd.conf and python.conf files. But still it is not
working.

The Python module (mod_python) is getting loaded. Because when I
telnet to my server, I can find that in the headers.

These are the versions of the softwares:
Apache: 2.0.47
Python: 2.2.3mod_python : 3.0.3

Thnaks for all your suggestions.
What is the Apache configuration snippet you are using to enable
mod_python and PSP file handling?

Graham
Jul 22 '08 #2
On Jul 22, 5:18*am, Graham Dumpleton <Graham.Dumple. ..@gmail.com>
wrote:
On Jul 21, 9:42*pm, barun.sah...@gm ail.com wrote:


Hi,
I am facing a very basic problem with PSP. I have installedmod_py thon
(in fedora Core 1), added the lines required for loading Python
modules and handling PSP pages. I have created a hello.psp page. But
when I try to view this hello.psp page, all Python code are getting
displayed.
The said page is stored at /var/www/html/psp/hello.psp. I guess this
is some configuration problem with Apache, but not able to figure out
the exact problem. I have tried putting those configuration lines for
psp in both httpd.conf and python.conf files. But still it is not
working.
The Python module (mod_python) is getting loaded. Because when I
telnet to my server, I can find that in the headers.
These are the versions of the softwares:
Apache: 2.0.47
Python: 2.2.3mod_python : 3.0.3
Thnaks for all your suggestions.

What is the Apache configuration snippet you are using to enable
mod_python and PSP file handling?

Graham- Hide quoted text -

- Show quoted text -
Hi Graham,

The configuration used in httpd.conf file looks like:
<Directory /var/www/html/psp>
AddHandler .psp .psp_
PythonHandler modules/python
PythonDebug On
</Directory>
Jul 22 '08 #3
ba**********@gm ail.com <ba**********@g mail.com>:
Hi,

I am facing a very basic problem with PSP. I have installed mod_python
(in fedora Core 1), added the lines required for loading Python
modules and handling PSP pages. I have created a hello.psp page. But
when I try to view this hello.psp page, all Python code are getting
displayed.
Not directly related to this issue, but I wouldn't start developing with
PSP. Modern web development is better done with a WSGI compatible
framework like Django ...

--
Freedom is always the freedom of dissenters.
(Rosa Luxemburg)
Jul 22 '08 #4
On Jul 22, 5:36 pm, "Sebastian \"lunar\" Wiesner"
<basti.wies...@ gmx.netwrote:
barun.sah...@gm ail.com <barun.sah...@g mail.com>:
Hi,
I am facing a very basic problem with PSP. I have installed mod_python
(in fedora Core 1), added the lines required for loading Python
modules and handling PSP pages. I have created a hello.psp page. But
when I try to view this hello.psp page, all Python code are getting
displayed.

Not directly related to this issue, but I wouldn't start developing with
PSP. Modern web development is better done with a WSGI compatible
framework like Django ...

--
Freedom is always the freedom of dissenters.
(Rosa Luxemburg)
Thanks to all. But can someone suggest me what the possible cause/
solution for this behaviour could be?
Jul 23 '08 #5
On Jul 22, 1:54*pm, barun.sah...@gm ail.com wrote:
On Jul 22, 5:18*am, Graham Dumpleton <Graham.Dumple. ..@gmail.com>
wrote:
On Jul 21, 9:42*pm, barun.sah...@gm ail.com wrote:
Hi,
I am facing a very basic problem with PSP. I have installedmod_py thon
(in fedora Core 1), added the lines required for loading Python
modules and handling PSP pages. I have created a hello.psp page. But
when I try to view this hello.psp page, all Python code are getting
displayed.
The said page is stored at /var/www/html/psp/hello.psp. I guess this
is some configuration problem with Apache, but not able to figure out
the exact problem. I have tried putting those configuration lines for
psp in both httpd.conf and python.conf files. But still it is not
working.
The Python module (mod_python) is getting loaded. Because when I
telnet to my server, I can find that in the headers.
These are the versions of the softwares:
Apache: 2.0.47
Python: 2.2.3mod_python : 3.0.3
Thnaks for all your suggestions.
What is the Apache configuration snippet you are using to enable
mod_pythonand PSP file handling?
Graham- Hide quoted text -
- Show quoted text -

Hi Graham,

The configuration used in httpd.conf file looks like:
<Directory /var/www/html/psp>
* * AddHandler .psp .psp_
* * PythonHandler modules/python
* * PythonDebug On
</Directory>
Go read the documentation properly.

http://www.modpython.org/live/curren.../hand-psp.html

What is PythonHandler set to?

Graham
Jul 23 '08 #6
On Jul 23, 6:18 pm, Graham Dumpleton <Graham.Dumple. ..@gmail.com>
wrote:
On Jul 22, 1:54 pm, barun.sah...@gm ail.com wrote:
On Jul 22, 5:18 am, Graham Dumpleton <Graham.Dumple. ..@gmail.com>
wrote:
On Jul 21, 9:42 pm, barun.sah...@gm ail.com wrote:
Hi,
I am facing a very basic problem with PSP. I have installedmod_py thon
(in fedora Core 1), added the lines required for loading Python
modules and handling PSP pages. I have created a hello.psp page. But
when I try to view this hello.psp page, all Python code are getting
displayed.
The said page is stored at /var/www/html/psp/hello.psp. I guess this
is some configuration problem with Apache, but not able to figure out
the exact problem. I have tried putting those configuration lines for
psp in both httpd.conf and python.conf files. But still it is not
working.
The Python module (mod_python) is getting loaded. Because when I
telnet to my server, I can find that in the headers.
These are the versions of the softwares:
Apache: 2.0.47
Python: 2.2.3mod_python : 3.0.3
Thnaks for all your suggestions.
What is the Apache configuration snippet you are using to enable
>mod_pythonan d PSP file handling?
Graham- Hide quoted text -
- Show quoted text -
Hi Graham,
The configuration used in httpd.conf file looks like:
<Directory /var/www/html/psp>
AddHandler .psp .psp_
PythonHandler modules/python
PythonDebug On
</Directory>

Go read the documentation properly.

http://www.modpython.org/live/curren.../hand-psp.html

What is PythonHandler set to?

Graham
Hi Graham,

I'm extremely sorry. I had typed wrongly the configuration. Following
is the one I'm using:

<Directory /var/www/html/psp>
AddHandler mod_python .psp .psp_
PythonHandler mod_python.psp
PythonDebug On
</Directory>

Strange thing is, same thing is working in windows, but not in Linux.
Jul 23 '08 #7

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

Similar topics

12
1977
by: news.telenet.be | last post by:
Hi, i'm looking at python to do programming for the new intranet here at the company. I'm looking at plone/zope also. Before, I've used jsp for webprogramming but i'm considering python for this. One thing that isn't clear to me is if it's possible to include python code in a html page like you would do with jsp and then have zope "translate" that to html. With jsp, one could use an apache/tomcat combo to accomplish this.
27
2063
by: Florian Lindner | last post by:
Hello, I've been using Python a lot for scripting (mainly scripts for server administration / DB access). All these scripts were shell based. Now I'm considering using Python (with mod_python on Apache 2) for a web project, just how I've used PHP in some smaller Projects before (<?php print "foo" ?>).. How suitable is Python for these kind of projects? What do think? Does the stdlib offers all basic functions for this kind of...
12
2963
by: vpr | last post by:
Hi All I want to build an Website using Apache / Python and MySQL. I dont want to spend to much time hacking html. I'm looking for some recommendations e.g. should I be using mod_python ? whats the best module for mysql ? any suggestings so I could get my site up in a day ?
13
9098
by: John Salerno | last post by:
I'm hoping someone can give me the basics for how to do very simple things with Python scripts from within my HTML. For example, I know that I can do this in PHP: <h1>Here is a header</h1> <?php include("file.html"); ?> // include some external html <p>More html</p> So to do this with Python, do I simply integrate it into the HTML as above, with no extra steps? Also, which symbols do I use to denote
37
2487
by: John Salerno | last post by:
I contacted my domain host about how Python is implemented on their server, and got this response: ------------------- Hello John, Please be informed that the implementation of python in our server is through mod_python integration with the apache. These are the steps needed for you to be able to run .py script directly
3
1481
by: exhuma.twn | last post by:
Simple problem: When I define a funtion the way you would with the publisher handler (without using psp), all works as expected. However when I define a publisher-like function and instantiate a PSP object in it ( as suggested on http://www.onlamp.com/pub/a/python/2004/02/26/python_server_pages.html ) mod_python seems to fail to tell the browser which content-type the document has. The output is what I expect it to be, but instead of...
4
4710
by: John Salerno | last post by:
I get this internal error message when I try to access a PSP page: "Invalid command 'PythonHandler', perhaps mis-spelled or defined by a module not included in the server configuration" So it seems that mod_python is not fully configured yet to handled PSP pages. When I check the installed Apache handlers, there is an entry called "mod_python .psp" where the first term is the handler and the second is the extension. I also tried adding...
48
2456
by: northband | last post by:
Hi, I am interested in re-writing my website in Python vs PHP but have a few questions. Here are my specs, please advise as to which configuration would be best: 1.Dell Poweredge Server, w/IIS, currently Windows but considering FreeBSD 2. Site consists of result pages for auctions and items for sale (100 per page) 3. MySQL (Dell Poweredge w/AMD) database server connected to my web server
8
4175
by: Nagarajan | last post by:
Hi group, I need to develop a web application. I am in a fix as to choose among the various server-side scripting options. I want to explore python (am a newbie) to gain expertise and upon search, I learnt about PSP(Python Server Pages) that uses Jython as its scripting language. Is it a better option over PHP or Perl? Could anyone point out the pros and cons of using PSP over others? Help much appreciated.
0
8675
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8862
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7729
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.