Django on IIS with Multiple Sites: How To Make ISAPI.py Cooperate
Python 2.6.2 / Django 1.0.2 on Win 2003 Standard IIS 6.
IIs is running two django sites with the following directory structure:
root/http/WEBSITE1 root/http/WEBSITE2
Both sites have their own application pools; each site has it's own pyISAPIe.dll instance.
WEBSITE1 is accessible (serving test django page). However, the browser produces the following for WEBSITE2:
Internal Server Error An error occurred processing this request.
Request handler failed
Traceback (most recent call last): File "D:Python26libsite-packagesHttpIsapi.py", line 67, in Request return RunWSGI(Handler, Base=Base) File "D:Python26libsite-packagesHttpWSGI.py", line 155, in RunWSGI Result = Application(Environ, StartResponse) File "D:Python26libsite-packagesdjangocorehandlerswsgi.py", line 241, in call response = self.get_response(request) File "D:Python26libsite-packagesdjangocorehandlersbase.py", line 122, in get_response return self.handle_uncaught_exception(request, resolver, sys.exc_info()) File "D:Python26libsite-packagesdjangocorehandlersbase.py", line 166, in handle_uncaught_exception return callback(request, **param_dict) File "D:Python26libsite-packagesdjangoviewsdefaults.py", line 23, in server_error t = loader.get_template(template_name) # You need to create a 500.html template. File "D:Python26libsite-packagesdjangotemplateloader.py", line 81, in get_template source, origin = find_template_source(template_name) File "D:Python26libsite-packagesdjangotemplateloader.py", line 74, in find_template_source raise TemplateDoesNotExist, name django.template.TemplateDoesNotExist: 500.html
It seems to me that "Isapi.py" located in root/pytho26/Lib/site-packages/Http has everything to do with this because of the "os.environ["DJANGO_SETTINGS_MODULE"] = "WEBSITE1.settings"
How can I modify this file or position it so that both sites run independently.
For anyone interested, the solution lies here
http://groups.google.com/group/pyisapie/browse_thread/thread/b67e861c85e1b26a
Follow option #3 to the letter and you will be able to run multiple IIS sites.
链接地址: http://www.djcxy.com/p/40562.html上一篇: 在debug.py列表索引超出范围