mod-python

psp (python server pages) code under mod_wsgi?

Is there some way to run .psp (python server pages) code under apache + mod_wsgi? While we are moving towards newer wsgi based frameworks we still have some legacy code written in psp which runs under mod_python. We'd like to be able to run it on the same server that hosts other wsgi based python code. In short - is there a way to supp...

How do I change which version of python mod_python uses

I'm doing some introductory work with django which seems really easy (and fun) so far but I have been doing all this from Python 2.6 which I installed in /opt/local (RedHat 5.3) because the python that came with redhat was 2.4. I set up a symlink: /usr/bin/python2.6 -> /opt/local/bin/python and I have been using that for all the djang...

Python: Need to replace a series of different substrings in HTML template with additional HTML or database results

Situation: I am writing a basic templating system in Python/mod_python that reads in a main HTML template and replaces instances of ":value:" throughout the document with additional HTML or db results and then returns it as a view to the user. I am not trying to replace all instances of 1 substring. Values can vary. There is a finite...

Modpython and virtualenv

Is it any way to run django site on virtualenv without administration rights? How can I do it? Virtualenv is already installed. ...

Reading request parameters in Python

Hi All I am very new to python and having to get into this stuff for a simple program to integrate with an ASP.NET application that I am building. The pseudo code is as follows. Get two parameters from request. (A ASP.NET will be calling this url by POST and sending two parameters) Internally execute some business logic and build some...

(django initial setup) Django installation is redirecting all traffic to django page, fix?

I'm a complete newbie to Django. I've been trying to get it working on my Ubuntu server. everytime someone my server, it redirects to the "Congratulations on your first Django-powered page." It completely ignores the index.html file in the www directory. Why is that? Is there a away to make it so that it only goes to the django page whe...

Catching errors when logging with SocketHandler in Python

My web application runs on multpile apache instances and I am having multiprocess logging issues because of this. I am currently using a SocketHandler for logging to a daemon using SocketServer that then writes logs to a single log file (similar to this example). Now that I am using a SocketHandler for logging I am having trouble disco...

mod_python not detecting files when using open()

I am trying to open a file I have in my /var/www/ directory named cardlist.xml. this is the code I am using. import cgi import os open("./cardlist.xml", "r") def crawlXml(): return 0 My error is MOD_PYTHON ERROR ProcessId: 11361 Interpreter: '127.0.1.1' ServerName: '127.0.1.1' DocumentRoot: '/var/www' ...

UserDIr on a django server

I have a django website running with mod_python and Apache. The current configuration directs all / traffic to the django site. Now, I need to enable userDir /~user on the machine as well. I have enabled the userDir module in Apache. Since, Apache is redirecting all the request to the django app, /~user is not working as the django just ...

modpython django basic auth handler does not pass user to view

Hi, I'm using django with apache mod_python. I authenticate users via the basic auth handler (django.contrib.auth.handlers.modpython) [1]. My views get only an instance of AnonymousUser passed in request.user. What am I doing wrong? [1]: it's an API that is https only, so it shouldn't be a security problem. ...

python 2.6.4 doesn't support mod_python?

Hi, am looking for a way to run django by just using my xampp, and i bumped into this tutorial online http://jyotirmaya.blogspot.com/2008/11/xampp-python-django.html according to the author, mod_python 3.3.1 is not supported by python 2.6, but the blog post was created more then a year ago i think. is this thing still true until now? or ...

Share data between mod_python processes

I'm running mod_python under Apache. If I've understood correctly, each Apache process runs its own Python interpreter. What would be the best way to share a tiny amount of data across all the processes? I'm talking about just a few hundred bytes here, making something database based completely overkill. ...

Switching mod_python from using python2.4 to python2.5

My goal is to have Apache process a python script and output to the requesting client. My server has both Python2.4 and Python2.5.5 installed. I have Apache configured to correctly process python scripts and tested with a simple test script. However, the real script I am trying to run requires Python2.5.5. Mod_Python seems to be utilizi...

How can manage many user requests to an apache web server using win32com in python?

Hello every body, I work on a Web text-to-speech System, trasforming text documents in audio mp3 files, using python 2.5. I use Apache2.2 as a server and mod_python as module to embed the Python interpreter within the server. The user should submit via web interface (input interface), a file txt or a Word document (.doc or .rtf) and th...

Python OpenID error: No matching endpoint found after discovering [uri]

Hello, I'm getting a "No matching endpoint found after discovering [openid identifier]" error when I invoke complete() method of the consumer. The funny thing is that out of the four OpenID providers I have tested, this behavior is observed only with LiveJournal. What steps can you suggest to investigate and fix the problem? store = F...

Getting rid of Django IOErrors

I'm running a Django site (via Apache/mod_python) and I use Django's facilities to inform me and other developers about internal server errors. Sometimes errors like those appear: Traceback (most recent call last): File "/opt/webapp/externals/lib/django/core/handlers/base.py", line 92, in get_response response = callback(request,...

How to run multiple versions of a Django app with mod_python?

I want to set up test and production versions of a Django app on separate apache name virtual hosts and wanted to know the best way to do this. Here's what I've done, and it seems to work ok, but I'm wondering if there's a better way. <VirtualHost *> ServerName test.foo.bar <Location "/app/"> SetHandler python-progra...

Django logs: any tutorial to log to a file

Hi, I am working with a django project, I haven't started. The developed working on the project left. During the knowledge transfer, it was told to me that all the events are logged to the database. I don't find the database interface useful to search for logs and sometimes they don't even log(I might be wrong). I want to know, if there...

Djangobb problem

I've installed Djangobb app on my server (Debian, mod_python) by cloning original source. The only things I've changed is database options in settings.py. All needed components are installed - syncdb query was executed right. But, when I'm trying to enter on my forum, it returns me error: ImproperlyConfigured: Error importing middle...

How do you throw an HTTP error with mod_python

I have a setup where I'm serving simple python pages using the mod_python publisher. At some points I'd like to have the python function raise a standard apache error - for example throwing a 500 error if a required file is missing. How can I throw an apache error from within a mod_python script? ...