I wrote not long ago about running Django 0.95 on Windows. I've since stumbled on a few more issues with Django:
- Timezone issues
No matter what timezone you set in settings.py, it won't work properly because there is a bug. Get the patch from ticket 2315 to fix the problem. If you are using sqlite3, the timezone that is used for Beijing time is 'Asia/Shanghai PRC' on Microsoft Windows (please refer to UPDATE2 below). On the other hand, if you are using postgresql, you need to change it to 'Asia/Shanghai'.
- Support for Unicode filenames
The default behaviour for uploading files with Unicode filenames is to use the following regex to replace characters before saving it: [^-A-Za-z0-9_.]. This might not be the behaviour that you might want. There is some discussion here in ticket 1355. It seems that the filenames in Windows NTFS filesystem support Unicode (utf-16). I've made some changes to the Django source to solve this problem. I am sure I haven't covered all the cases but it works for what I want it to do for now.
Another issue that I've encountered when running on a Apache + mod_python + Django + PostgreSQL setup on Windows is that you might run out of ports.
WHAT? How can that happen? 
Basically, what happens is that Windows default TCP/IP subsystem don't release the ports until its idle for 4 minutes and there is a limited range of ports that can be used by user programs. So, if you are making a large number of requests to the web server for a short period of time, Django might fail to open new connections to the database. It can be changed by tweaking some registry settings.
Check it out here for a detailed explanation and discussion about this issue. I am not sure, but maybe this problem can be solved with some caching for database server with high traffic. Hmmmm, running a Windows server on a high traffic site with default configs? I don't think so
.
UPDATE1: I messed up the previous post and this is a repost. Oh bugger!
UPDATE2: Seems like the 'Asia/Shanghai PRC' timezone for sqlite3 doesn't apply to my Debian GNU/Linux setup at work.

Recent Comments