Code

Changes between Version 4 and Version 5 of DjangoOnWindowsWithIISAndSQLServer


Ignore:
Timestamp:
06/26/06 10:55:53 (8 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DjangoOnWindowsWithIISAndSQLServer

    v4 v5  
    55Useful 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. 
    66 
    7 Edit: NB, I'm working from Windows Server 2003/IIS 6 and SQL Server 2005. 
     7This may take a while. Best attempted with a mug of caffeinated beverage handy. 
     8 
     9NB, I'm working from Windows Server 2003/IIS 6 and SQL Server 2005. 
     10 
     11NB 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 
    813Credit 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. 
    914 
     
    1419 * Install an ISAPI extension for IIS 
    1520 * Install Django 
     21 * Combine Django and IIS 
    1622 * Configure Django to look at SQL Server 
    1723 * Test 
    1824 * Celebrate 
    1925 
    20 == Installing Python == 
     26== Install Python == 
    2127Head 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 
     29Phew. Easy bit over with, it gets harder from here on in. 
    2230 
    2331== Install Win32 extensions for Python == 
     
    2836 
    2937== Install an ISAPI extension for IIS == 
     38Lots of steps, and no installer. 
     39 
    3040This 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. 
    3141 
     
    4656It should work. If it doesn't, when you find out why please come back and explain what happened and how you fixed it. ;) 
    4757 
    48 The PyISAPIe extension has a driver for Django as well, so that's where I will be heading next. 
     58The PyISAPIe extension has a driver for Django as well, so that's where I will be heading, after this: 
    4959 
    50 == Install Django == 
     60== Installing Django == 
     61I'm not going to say what this is; if you're here, following this, then you should really know by now! 
    5162 
    5263=== Get the development version if you wish === 
     
    5768Otherwise, just download Django from the main site, and extract the archive to a folder. 
    5869 
    59 === Install of Django === 
     70=== Do The Install === 
    6071Drop to a command prompt (start -> run -> cmd -> OK), change to your Python folder and install Django. Example: 
    6172{{{ 
     
    8596 
    8697=== 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. 
     98Next, 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. 
    8899 
    89100=== 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. 
     101You have created a new virtual folder in IIS, and added the PyISAPI extension and tweaked it to drive django sites. 
    91102There is also an addition to Django so it can be driven by PyISAPIe. 
    92103And, you can now use django-admin.py to create a site inside the virtual folder. 
     
    94105You have everything you need to have Django running from IIS. 
    95106 
    96 ... 
     107... I'll leave you to sort out your Import Path and DJANGO_SETTINGS_MODULE and stuff ... 
    97108 
    98 I'll update this page when I get it working. ;) 
     109Now, 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 == 
     112With any luck, the suggestion that there is an ado_mssql backend will do, and this will be easy.