Thursday, May 24, 2012

Deploying Django 1.3 on IIS using PyISAPIe 64 bit on Python 2.7

I compiled PyISAPIe on Python 2.7.2, 64 bit I have test it myself and it is working.
If also need to use pyodbc in project, download  and use this link "pyodbc-3.0.5 amd64" otherwise on most other versions you will get ImportError. Instruction on how to deploy django on IIS can be found on this post

Installing pyodbc on ubuntu

Installing pyodbc is straight forward but if getting  "error: command 'gcc' failed with exit status 1" when installing pyodbc, make sure you have installed requirements as below.
sudo apt-get install unixODBC-dev g++
pip install pyodbc

Installing Python Imaging Library(PIL) on ubuntu

Install required packages
sudo apt-get install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev python-dev
Fixing the lib path
sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib
sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib
sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib
Install the PIL
pip install pil
If getting "ImportError: No module named PIL" on importing Image module also try
from PIL import Image

If not using virtualenv "$ sudo apt-get install python-imaging" will also install pil for the system.