mod-python

Django: Mod_python error: ImportError: Could not import settings

I'm a complete noob here, so please bare with me on this one. Trying to get django to work with apache, and i'm getting the following error: ImportError: Could not import settings 'MyDjangoApp.settings' (Is it on sys.path? Does it have syntax errors?): No module named MyDjangoApp.settings My django app is located in /home/user/djan...

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 expect that cache to be reset when the web service is restarted, but it doesn't appear to ...

Restarting a Django application running on Apache + mod_python

I'm running a Django app on Apache + mod_python. When I make some changes to the code, sometimes they have effect immediately, other times they don't, until I restart Apache. However I don't really want to do that since it's a production server running other stuff too. Is there some other way to force that? Just to make it clear, since ...

Django apache mod-python setup (vista)

I am trying to setup my development environment on my local vista machine (django+apache+mod-python+postgres) and for some reason I can't load the settings. Everything works on the built-in server but not under apache. Here is my httpd.conf <Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpyt...

Apache, SVN and mod_python

We are using Apache 2.2 to server SVN (1.6.2) repositories on Windows. We use SSPI for authentication, and that's working. We have a number of different repositories, and use SVNParentPath in the httpd.conf to serve them. Something like: <Location /> DAV svn SVNParentPath c:\repos [SSPI stuff] </Location> So from a client...

Execution of script using Popen fails....

I need to execute a script in the background through a service. The service kicks off the script using Popen. p = Popen('/path/to/script/script.py', shell=True) Why doesn't the following script work when I include the file writes in the for loop? #!/usr/bin/python import os import time def run(): fd = open('/home/dilleyjrr/tes...

Python Server Pages Implementations

I've been a PHP developer for quite awhile, and I've heard good things about using Python for web scripting. After a bit of research, I found mod_python, which integrates with Apache to allow Python Server Pages, which seem very similar to the PHP pages I'm used to. I also found a mod_wsgi which looks similar. I was wondering which impl...

How to Compile Mod_Python 3.3.1 for Python 2.6 and Apache 2.2 on Windows?

I have no experience compiling code other than using Visual Studio's Build command. I am hoping we can create a step by step guide for compiling mod_python on windows. Please be as descriptive as possible. This is what I've done so far: Download and install python 2.6.2 Download and install apache 2.2.11 Download the most recent sourc...

Django newbie deployment question - ImportError: Could not import settings 'settings'

Hello folks, The app runs fine using django internal server however when I use apache + mod_python I get the below error File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py", line 75, in __init__ raise ImportError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SE...

How to setup mod_python configuration variables?

I'm running a Python server with mod_python, and I've run into some issues with configuration variables. This is actually two questions rolled into one, because I think they are highly related: I need a way to configure variables that will be available in Python while running. I currently just have a module that sets some name-value ...

How to co host django app with php5 on apache2 with mod_python ?

Hi folks, I have django+python+apache2+mod_python installed hosted and working on ubuntu server/ linode VPS. php5 is installed and configured. We don't have a domain name as in example.com. Just IP address. So my apache .conf file looks like this ServerAdmin webmaster@localhost DocumentRoot /var/www <Location "/">...

Exclude path from urls.py in django

I have set django.root to the root path in the url after the slash. But I want to have a download dialog in a subfolder of the root url which should not be accessed by urls.py. Is there any possibility to avoid access on urls.py and use instead the location of the apache configuration. Sorry, but this problem is very tricky and I hope yo...

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 session. The mod_python publisher handler that is apparently capable of persisting stuff does not al...

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. ...

Stackless python stopped mod_python/apache from working.

Hello I installed stackless pyton 2.6.2 after reading several sites that said its fully compatible with vanilla python. After installing i found that my django applications do not work any more. I did reinstall django (1.1) again and now im kind of lost. The error that i get is 500: Internal Server Error The server encountered an int...

mod_python problem?

I have been working on a website using mod_python, python, and SQL Alchemy when I ran into a strange problem: When I query the database for all of the records, it returns the correct result set; however, when I refresh the page, it returns me a result set with that same result set appended to it. I get more result sets "stacked" on top o...

Configure Django project in a subdirectory using mod_python. Admin not working.

HI guys. I was trying to configure my django project in a subdirectory of the root, but didn't get things working.(LOcally it works perfect). I followed the django official django documentarion to deploy a project with mod_python. The real problem is that I am getting "Page not found" errors, whenever I try to go to the admin or any view...

mod_python interpreter's cache not getting reset on script change?

I use mod_python.publisher to run Python code and discovered a problem: When I update a script the update doesn't always work right away and I get the same error I fixed with the update until I restart Apache. Sometimes it works right away, but sometimes not...but restarting Apache definitely always catches it up. It's a pain to have to...

making HTTP authentication optional with mod-python

Hi all, I've a web application that accesses multiple controller classes based on the parameters it is passed. For some of the controllers, I want users to authenticate themselves (by simple HTTP authentication), and for some I want public access. Is there a way to make this happen? In my .htaccess file, I now have AddHandler mod_pyth...

Mod_python produces no output

Hi, Just installed and configured mod_python 3.2.8 on a CentOS 5 (Apache 2.2.3) server with Python 2.4.3. It is loaded fine by Apache. I activated the mpinfo test page and it works. So I wrote a simple "Hello World" with the following code: from mod_python import apache def handler(req): req.content_type = 'text/plain' req.wr...