| 94 | | Next, you must follow the readme in the PyISAPIe 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. |
| | 95 | Next, you must follow the readme.txt in the PyISAPIe examples\django folder, basically copy two files into specific folders. Then edit them a bit in order to fit your needs. |
| | 96 | |
| | 97 | * Put Isapi.py in c:\python24\lib\site-packages\Http folder. According to the example given above, you'll make the following changes to it: |
| | 98 | |
| | 99 | {{{ |
| | 100 | # Add these two lines, and python will import DJANGO_SETTINGS_MODULE with no problem |
| | 101 | import sys |
| | 102 | sys.path.append(r'E:\test') |
| | 103 | |
| | 104 | # Indicate the settings module of your project |
| | 105 | os.environ["DJANGO_SETTINGS_MODULE"] = "proj.settings" |
| | 106 | }}} |
| | 107 | |
| | 108 | * Put pyisapie.py in c:\python24\lib\site-packages\Django-xyz-123.egg\django\core\handlers folder. But there's a bug in PyISAPIe v1.0.3 that prevent it from working (hopefully they'll fix it in the next release). What you have to do is to add a single line of code to the pyisapie.py file you just copied: |
| | 109 | |
| | 110 | {{{ |
| | 111 | # ...some stuff ahead |
| | 112 | |
| | 113 | class PyISAPIeRequest(http.HttpRequest): |
| | 114 | def __init__(This): |
| | 115 | # ADD THIS LINE! |
| | 116 | This.method = Env.REQUEST_METHOD |
| | 117 | |
| | 118 | # ...and don't need to change the rest |
| | 119 | |
| | 120 | # some stuff behind... |
| | 121 | }}} |