»
S
I
D
E
B
A
R
«
Tips and Tricks in Django on Windows 7
Dec 28th, 2009 by evereq
Some Tips and Tricks how to use Django on Windows 7
  • Question (Q): Why Django build-in Web Server (development server) works VERY SLOWLY on Windows 7 ? And how to fix this?
    Answer (A): seems it’s all about DNS… To fix this just open C:\Windows\system32\drivers\etc\hosts file (in notepad for example) and uncomment (i.e. remove “#”) in the following line: 127.0.0.1 localhost
  • to be continue…
Some Django Links
Nov 21st, 2009 by evereq

Some interesting Django related links:

A Django project. - Django Project Home
Tips and Tricks in Installation of PIL on Windows 7 / 2008 64bit
Nov 12th, 2009 by evereq
  1. 1) libtiff
download sources (zip) from http://gnuwin32.sourceforge.net/packages/tiff.htm
2) zlib
download sources (zip) from http://gnuwin32.sourceforge.net/packages/zlib.htm
3) libjpg
download sources (zip) from http://gnuwin32.sourceforge.net/packages/jpeg.htm
http://www.wiredfool.com/2005/10/29/how-to-build-the-python-imaging-library-for-windows/
http://boodebr.org/main/python/build-windows-extensions

Installation of Python Image Library (PIL)

It will be a problems with PIL installation on  Windows 7 64 bit, so you will need to install library from source code:

  1. Download PIL library source code from http://www.pythonware.com/products/pil/
  2. Unpack it to any  folder, for example C:\PIL
  3. Run in command prompt (cmd):
    cd c:\PIL
    python setup.py install

    This will install library, but without support for TKINTER, JPEG, ZLIB (PNG/ZIP) and FREETYPE2 (i.e. actually without anything :D )

So let’s add support for at least JPEG and PNG. To do this, you will need to download following libraries:

  1. libtiff – download sources (zip) from http://gnuwin32.sourceforge.net/packages/tiff.htm
  2. zlib – download sources (zip) from http://gnuwin32.sourceforge.net/packages/zlib.htm
  3. libjpg – download sources (zip) from http://gnuwin32.sourceforge.net/packages/jpeg.htm

Following blog posts will help you to continue with installation:

Notes:

  1. Possible that you will need to remove
     include  

    from some *.h source files as this needed to be included only on Unix (ok, at least not on Windows)
    For example you will need to delete such line from zconf.h in zlib sources before try to run nmake for zlib.

  2. Don’t forget to set PIL library pointers (in setup.py of PIL) to point to the locations where you put zlib, libjpg and libtiff. If you forget to setup  - PIL will not found them and you will get what I describe in the beging of post – I.e. nothing :D .
    This is for example what you need to set for zlib in setup.py of PIL in case if you copy zlib sources to c:\PIL\zlib folder (I assume that you unzip PIL into c:\PIL here):

    ZLIB_ROOT = './zlib'
  3. You also can found yourself with finding all the 32-bit times “__time32_t” and changing it to “time_t” for 64-bit conversion ;-)
»  Substance: WordPress   »  Style: Ahren Ahimsa
© Copyright 2008–2010 EvereQ.com All rights reserved. Logos, company names used here if any are only for reference purposes and they may be respective owners right or trademarks.