Changes between Version 4 and Version 5 of DjangoOnWindowsWithIISAndSQLServer
- Timestamp:
- Jun 26, 2006, 12:55:53 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DjangoOnWindowsWithIISAndSQLServer
v4 v5 5 5 Useful for people who already have such a setup (You wont find me discussing the installation of SQL Server here) and can't justify (or just don't want) Apache and PostgreSQL as well. 6 6 7 Edit: NB, I'm working from Windows Server 2003/IIS 6 and SQL Server 2005. 7 This may take a while. Best attempted with a mug of caffeinated beverage handy. 8 9 NB, I'm working from Windows Server 2003/IIS 6 and SQL Server 2005. 10 11 NB also: The whole point of this is to keep Python running even when not serving requests, to reduce the overhead of starting Python all the time. This means that a lot of changes you make while configuring it wont take effect until you do a full IIS restart. 12 8 13 Credit to: http://thinkhole.org/wp/2006/04/03/django-on-windows-howto/ for the Django on Windows with Postgres/Apache guide, from which I have grabbed some parts of the django-on-windows setup. 9 14 … … 14 19 * Install an ISAPI extension for IIS 15 20 * Install Django 21 * Combine Django and IIS 16 22 * Configure Django to look at SQL Server 17 23 * Test 18 24 * Celebrate 19 25 20 == Install ingPython ==26 == Install Python == 21 27 Head to http://www.python.org/ and look at the menu on the left; in the "quick links" section is a link to the Windows installer for the latest stable version of Python. Download and run it, following the wizard steps until it is complete. 28 29 Phew. Easy bit over with, it gets harder from here on in. 22 30 23 31 == Install Win32 extensions for Python == … … 28 36 29 37 == Install an ISAPI extension for IIS == 38 Lots of steps, and no installer. 39 30 40 This is an extension that loads the Python interpreter into memory while IIS is running, and uses it to serve requests more quickly. CGI apps need to start a new instance of the interpreter for every request, this does not have that overhead - it performs a similar service to mod_python on Apache servers. 31 41 … … 46 56 It should work. If it doesn't, when you find out why please come back and explain what happened and how you fixed it. ;) 47 57 48 The PyISAPIe extension has a driver for Django as well, so that's where I will be heading next.58 The PyISAPIe extension has a driver for Django as well, so that's where I will be heading, after this: 49 59 50 == Install Django == 60 == Installing Django == 61 I'm not going to say what this is; if you're here, following this, then you should really know by now! 51 62 52 63 === Get the development version if you wish === … … 57 68 Otherwise, just download Django from the main site, and extract the archive to a folder. 58 69 59 === Install of Django===70 === Do The Install === 60 71 Drop to a command prompt (start -> run -> cmd -> OK), change to your Python folder and install Django. Example: 61 72 {{{ … … 85 96 86 97 === Linking Django to PyISAPI === 87 Next, you must follow the readme in the PyISAPI examples\django folder (it explains where to copy two files ). Then edit the isapi.py file you just copied. See where it says you should change a line? If applicable, edit it for your django.settings.module settings.98 Next, you must follow the readme in the PyISAPI examples\django folder (it explains where to copy two files - one goes into the Django install (One goes into python24\lib\site-packages\django-xyz-123.egg\core\handlers\). Then edit the isapi.py file you just copied to lib\site-packages\http\. See where it says you should change a line? If applicable, edit it for your django.settings.module settings. 88 99 89 100 === Serving Django with IIS === 90 You have created a new virtual folder in IIS, and added the PyISAPI extension ,and tweaked it to drive django sites.101 You have created a new virtual folder in IIS, and added the PyISAPI extension and tweaked it to drive django sites. 91 102 There is also an addition to Django so it can be driven by PyISAPIe. 92 103 And, you can now use django-admin.py to create a site inside the virtual folder. … … 94 105 You have everything you need to have Django running from IIS. 95 106 96 ... 107 ... I'll leave you to sort out your Import Path and DJANGO_SETTINGS_MODULE and stuff ... 97 108 98 I'll update this page when I get it working. ;) 109 Now, while I don't have an app running, I do have Django errors rather than IIS errors. I need to get my model access sorted for my test app. 110 111 == Configure Django to look at SQL Server == 112 With any luck, the suggestion that there is an ado_mssql backend will do, and this will be easy.