Google Groups Home Help | Sign in
IIS, pyisapie, and DJANGO_SETTINGS_MODULE
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
rcs_comp  
View profile
 More options May 9, 4:24 am
From: rcs_comp <rsyr...@gmail.com>
Date: Fri, 9 May 2008 01:24:22 -0700 (PDT)
Local: Fri, May 9 2008 4:24 am
Subject: IIS, pyisapie, and DJANGO_SETTINGS_MODULE
So I have setup Django on IIS using PyISAPIe and am happy with the
performance so far.  On my dev box running IIS 5.1, I am getting ~170
requests per second processed for the simple poll application.

Django is running as a WSGI application.  I have reconfigured the
PyISAPIe files to look for a default configuration file in a virtual
directory.  Therefore, each virtual directory and/or website can have
its own python configuration file.  My intent was to be able to
specify a different Django project for multiple different virtual
directories/websites.  The configuration file per virtual directory
looks like this:

### START CODE

import os, sys
sys.path.append('D:/system_data/development/python/django')

from django.core.handlers.wsgi import WSGIHandler as DjangoHandler
from Http.WSGI import RunWSGI
import inspect, string

#
# The main request handler.
#
def Request():
  os.environ['DJANGO_SETTINGS_MODULE'] = 'dgtutorial2.settings'
  return RunWSGI(DjangoHandler())

### END CODE

The problem, which is documented on both the Django Wiki and in the
PyISAPIe documentation is that even though DJANGO_SETTINGS_MODULE is
being reset each time a page is being requested, it doesn't seem to
affect how Django is running.

I realize this probably has something to do with the fact that the
Django settings are being stored at the process level, so even though
the environment variable is being reset each time a request is made,
Django isn't actually reloading the settings.

Can someone help me by giving me a high-level overview of how Django
is working and how/why the settings are being stored at the process
level?  What would have to happen to get Django to re-process the
settings file each time a URL was requested?

In the end, my goal is to get a decently performing solution for
multiple installations of Django on an IIS server.  I am happy to put
some time and effort into working on a solution for this if someone
can help point me in the right direction.

Thanks.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google