Changes between Version 36 and Version 37 of DjangoOnWindowsWithIISAndSQLServer
- Timestamp:
- May 11, 2008, 2:31:06 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DjangoOnWindowsWithIISAndSQLServer
v36 v37 20 20 21 21 == Install PyISAPIe - an ISAPI extension for IIS == 22 There is no installer for this, so there are quite a few steps, but they aren't very complicated.23 22 24 Breifly, this is an IIS extension that loads the Python interpreter into memory while IIS is running, and uses it to serve page requests - it avoids the CGI overhead of restarting Python for every request. It does mean that some Django files will be cached and you wont see changes while testing your Django site until you restart the Python process. With IIS 6 you have to right-click on the application pool running your services and select 'recycle' for changes to take. Previous versions of IIS might need the whole IIS service to be restarted. 23 PyISAPIe is an IIS extension that loads the Python interpreter into memory while IIS is running, and uses it to serve page requests - it avoids the CGI overhead of restarting Python for every request. It does mean that some Django files will be cached and you wont see changes while testing your Django site until you restart the Python process. With IIS 6 you have to right-click on the application pool running your services and select 'recycle' for changes to take. Previous versions of IIS will need the whole IIS service to be restarted. 25 24 26 Now on with the setup: Go to http://pyisapie.sourceforge.net/ and download it (look in the menu on the right, under "Links" for a download link). Unzip the archive so you can copy files out of it.25 I will assume you are using c:\python25 as the folder where Python is installed, but please change these where necessary for your setup. 27 26 28 I will assume you've extracted it to c:\pyisapie, and are using c:\python25 as the folder where Python is installed, but please change these where necessary for your setup. 29 30 There is documentation in the readme files, but at the time of writing the install consists of: 27 If you have problems with PyISAPIe, check out the [http://groups.google.com/group/pyisapie?hl=en PyISAPIe Google Group] for support. 31 28 32 29 === Setting up Files === 33 * Copy c:\pyisapie\PyISAPIe.dll to c:\python25\34 * Edit the properties -> security settings o n that file, add "Network Service" and tick "read" permission. (So IIS can use it).30 * Go to http://pyisapie.sourceforge.net/ and download it (look in the menu on the right, under "Links" for a download link). Unzip the archive to c:\pyisapie. 31 * Edit the properties -> security settings of c:\pyisapie\PyISAPIe.dll, add "Network Service" and tick "read" permission. (So IIS can use it). 35 32 * Go to c:\pyisapie\source\PyISAPIe\Python\ and copy the entire Http folder to c:\python25\lib\site-packages. '''''Note:''' the Http folder is case sensitive. Saving in 'http' (or any other variation) will not work [SF]''. 36 33 … … 39 36 40 37 * Open the IIS Management Console, and create a new virtual directory, and allow executing ISAPI extensions when prompted by the wizard. 38 39 ==== Multiple Django Installations on IIS ==== 40 41 You can only run multiple instances of Django on IIS 6.0 if you use a separate instance of PyISAPIe for each Django instance. This is accomplished by setting up an IIS Application Pool for each PyISAPIe/Django instance that needs to be run. It would be great if multiple instances of Django could run under a single PyISAPIe instance. Please encourage the Django developers to work on this issue and/or contribute a fix yourself. You can find more information about this issue here: 42 43 * [http://code.djangoproject.com/ticket/2039 Trac Ticket: Provide a way to use django under IIS] 44 * [http://groups.google.com/group/pyisapie/browse_thread/thread/b67e861c85e1b26a?hl=en PyISAPIe Group: Multiple PyISAPIe Instances (for Django)] 45 * [http://groups.google.com/group/django-developers/browse_thread/thread/dfd69014daa36672 Developers Group: IIS, pyisapie, and DJANGO_SETTINGS_MODULE] 46 47 Multiple instances of Django on IIS 5.1 is not currently possible. 48 41 49 42 50 ==== IIS 6 ==== … … 61 69 62 70 That's it installed. In c:\pyisapie\source\PyISAPIe\Python\examples folder is a file called Info.py. Copy this to your new virtual directory folder, and then try and view http://site/Info.py to test it. It should work. If it doesn't, when you find out why, please come back and explain what happened and how you fixed it. ;) 63 * ''I got an error "Import Error: couldn't locate module Http.Isapi"; I resolved it by adding IUSR_machine read and execute access to the directory Http in site-packages [rnm]'' 64 * ''I also got "Import Error: couldn't locate module Http.Isapi", but was unable to fix it with the above solution. The only thing I can find, for now, is moving Http from site-packages to Lib. This seems like a potentially bad idea, however. [mao]'' 71 72 ==== IIS Troubleshooting ==== 73 * "Import Error: couldn't locate module Http.Isapi" -- see [http://groups.google.com/group/django-users/browse_thread/thread/1d2cbd681f2b6f7f Users Group: IIS 6 PyISAPIe problems] 74 65 75 66 76 == Django == … … 114 124 115 125 * Put pyisapie.py in c:\python25\lib\site-packages\Django-xyz-123.egg\django\core\handlers folder. 116 * It doesn't seem that ''IIS+Python+PyISAPIe'' support multiple Django sites.117 * ''This is related to the impossibility of having multiple values for DJANGO_SETTINGS_MODULE in os.environ within a single IIS worker process. Can said value be specified in the request env? [pjs]''118 126 119 127 === Serving Django with IIS ===