In deploying my Django 1.4 site to Azure, I've run into an issue with urls containing query strings.
The issue appears to be that certain environment variables used to transfer request info to my site is not being set correctly. Specifically PATH_INFO and QUERY_STRING.
PATH_INFO contains the full path after the hostname, including the query string, instead of just the path without any query string.
i.e. if the full url were www.example.com/test/user/?id=1 PATH_INFO contains /test/user/?id=1 instead of /test/user/
QUERY_STRING meanwhile is empty, rather than containing ?id=1
As a result, any url with a query string fails to resolve correctly because my urlconf is considering the query string as part of the url and so nothing matches. I suspect that a secondary issue would also be that if the url could resolve to something valid, any code depending on the query string would also fail since QUERY_STRING is not populated.
I'm using wfastcgi.py, which comes with the Python27 install present on an Azure website by default in D:/Python27/scripts/wfastcgi.py. I'm assuming this is the same wfastcgi.py found on the Downloads page here; which is why I figured I'd post my issue here.
I'm not certain if the issue lies with the IIS server in Azure or with the wfastcgi.py handler, or if this is even expected behaviour perhaps. I'm looking at the wfastcgi.py file now to see if I can further figure out how my issue might be occurring and how to fix it, but in the meantime if someone here has more knowledge about wfastcgi.py and/or IIS as it relates to Azure and can chime in, that would be very helpful.
I have a stackoverflow post about this issue as well if anyone here is a stackoverflow user and feels like answering there.
EDIT: I should probably also note that I followed this tutorial in setting up the site initially: http://www.windowsazure.com/en-us/develop/python/tutorials/web-sites-with-django/ since it seems to be the recommended method of using Django on Azure and was the instruction I used for setting up wfastcgi.py as my handler.
|