Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 10th, 2004, 10:53 PM
roypython roypython is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 71 roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 5
Question sending headers in mod_python

Hi, I need some help here please..
I'm using with mod_python.
In the request handler I want to redirect the client to a new url,
but it seems that the 'Locate' header(and any other header that I tried) is not being sent to the client.

The code of testPage.py is:

from mod_python import apache

def handler(req):
req.headers_out.add('Location:','http://www.cnn.com')
#req.write("blabla")

Here's the .htacess file's code:

AddHandler python-program .py
PythonHandler testPage
PythonDebug On

RewriteEngine on
RewriteRule !\.(gif|jpg|png|css)$ testPage.py


What am I doing wrong?!

thanks
Roy

Reply With Quote
  #2  
Old May 11th, 2004, 12:21 AM
roypython roypython is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 71 roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level)roypython User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 5
The answer..

using:

req.headers_out.add("Location", 'http://www.google.com/')
raise apache.SERVER_RETURN, apache.HTTP_SEE_OTHER

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > sending headers in mod_python


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





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