Questions tagged [mod-python]

Mod_python is an Apache module that embeds the Python interpreter within the server.

Mod_python is an Apache module that embeds the Python interpreter within the server. 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.

Currently mod_python is not under active development. This does not mean that it is "dead" as some people have claimed. It smiply means that the code and the project are mature enough when very little is required to maintain it.

Projects website:

Current State of Mod_Python

289 questions
2
votes
0 answers

using python to filter requests in apache

I'd like to intercept a user's HTTP POST request using a apache, modify it a little using python, then send it to the regular handler. Specifically I'll be renaming a POST parameter. I've seen mod_python has a feature called PythonInputFilter. But I…
Fidel
  • 7,027
  • 11
  • 57
  • 81
2
votes
3 answers

Django custom auth backend not recognized on Apache

I'm trying to deploy my Django application to an Apache2 based server with mod_python. I've set the handlers right and made the configuration to make mod_python work with my project. My project implements a custom auth backend to connect my users to…
Burcu Dogan
  • 9,153
  • 4
  • 34
  • 34
2
votes
1 answer

Failed to get separate instances of a class under mod_python

I'm trying to run some python code under Apache 2.2 / mod_python 3.2.8. Eventually the code does os.fork() and spawns 2 separate long-run processes. Each of those processes has to create a separate instance of a class in order to avoid any possible…
victorz
  • 2,209
  • 4
  • 19
  • 15
2
votes
2 answers

How can I configure Apache2/mod_python/Django to abort request processing after N seconds?

I recently spent a long while debugging something that turned out to be an infinite loop bug in my own code. Since I can't guarantee I'll never make that sort of mistake again, how can I configure my web server to terminate any apache2 subprocess…
Shimon Rura
  • 439
  • 4
  • 13
2
votes
3 answers

fatal: Not a git repository when installing mod_python

I'm trying to install mod_python but I got an error: SyntaxError: ('EOL while scanning string literal', ('/usr/local/lib/python2.7/dist-packages/mod_python/version.py', 3, 79, 'version = "fatal: Not a git repository (or any of the parent…
Juneyee
  • 389
  • 2
  • 6
  • 15
2
votes
2 answers

got errors when import mod_python

After finishing install mod_python, I got 500 Internal Server Error. I looked up the log, it says: python_handler: Can't get/create interpreter. Then I open a python terminal and to test if I can import mod_python. Then I got errors as follows: >>>…
Juneyee
  • 389
  • 2
  • 6
  • 15
2
votes
1 answer

Is there a difference between installing mod_python via httpd.conf and conf.d in apache?

I am working with a hosting provider who has installed mod_python for me. I followed the install instructions locally and included it in httpd.conf but they have opted to put it in conf.d/python.conf. Is there any difference/benefit to doing it…
Simon
  • 78,655
  • 25
  • 88
  • 118
2
votes
0 answers

Creating 4 mutexes based on 50 max processes, poor configuration?

Looking at the Apache error log on my server this notice appears frequently each day mod_python: Creating 4 session mutexes based on 50 max processes and 0 max threads. Today for example, it has occurred 7 times already between 23:59 and 09:35.…
blarg
  • 3,773
  • 11
  • 42
  • 71
2
votes
5 answers

Django, mod_python, apache and wacky sessions

I am running a Django through mod_python on Apache on a linux box. I have a custom authentication backend, and middleware that requires authentication for all pages, except static content. My problem is that after I log in, I will still randomly get…
Staale
  • 27,254
  • 23
  • 66
  • 85
2
votes
1 answer

mod_python no module named _apache

I am trying to run a python program which I have downloaded. It requires mod_python so I installed the latest version from source. I am also running Python 2.7 on Ubuntu 12.04. When I run the python file I get the following error: from mod_python…
sam
  • 2,469
  • 8
  • 37
  • 57
2
votes
2 answers

How to use Staticgenerator with Django + Apache + mod_python

I have currently an enviroment with Django + Apache via mod_python. How can I use Staticgenerator without nginx, just with Apache and mod_python? Thank you.
zenx
2
votes
1 answer

Alternatives to mod_python's CGI handler

I'm looking for the simplest way of using python and SQLAlchemy to produce some XML for a jQuery based HTTP client. Right now I'm using mod_python's CGI handler but I'm unhappy with the fact that I can't persist stuff like the SQLAlchemy…
diciu
  • 29,133
  • 4
  • 51
  • 68
2
votes
2 answers

django - ImportError: No module named modpython

I'm trying to setup django on my vhost and got stuck on this error: MOD_PYTHON ERROR ProcessId: 4496 Interpreter: 'ouiop' ServerName: 'ouiop.com' DocumentRoot: '/var/www/vhosts/ouiop.com/httpdocs' URI: '/' Location: …
user919487
  • 23
  • 1
  • 3
2
votes
1 answer

i update djang1.3.1 to djang1.4 , error: MOD_PYTHON ERROR

I updated djang1.3.1 to djang1.4. In my local env ,that's fine. but when i ci my code to server ,error happened! in my server , i can use 'python manage.py shell' and can 'import settings', that's all right, but still have this error, who can help…
yzliu
  • 21
  • 3
1
vote
2 answers

mod_python caching of variables

I'm using mod_python to run Trac in Apache. I'm developing a plugin and am not sure how global variables are stored/cached. I am new to python and have googled the subject and found that mod_python caches python modules (I think). However, I would…
Chris B
  • 5,311
  • 11
  • 45
  • 57