1************
2Requirements
3************
4
5Base requirements
6=================
7- `Python`_ 2.7+
8- `Django`_
9- :ref:`kvstore-requirements`
10- :ref:`image-library`
11
12.. _kvstore-requirements:
13
14Key Value Store
15===============
16sorl-thumbnail needs a Key Value Store for its operation. You can choose between
17a **cached database** which requires no special installation to your normal
18Django setup besides installing a proper cache like memcached **or** you can
19setup **redis** which requires a little bit more work.
20
21Cached DB
22---------
23All you need to use the cached database key value store is a database and `cache
24<http://docs.djangoproject.com/en/dev/topics/cache/>`_ setup properly using
25memcached. This cache needs to be really fast so **using anything else than
26memcached is not recomended**.
27
28Redis
29-----
30Redis is a fast key value store also suited for the job. To use the `redis`_ key
31value store you first need to install the `redis server
32<http://code.google.com/p/redis/>`_.  After that install the `redis client
33<https://github.com/andymccurdy/redis-py/>`_::
34
35    pip install redis
36
37
38.. _image-library:
39
40Image Library
41=============
42You need to have an image library installed. sorl-thumbnail ships with support
43for `Python Imaging Library`_, `pgmagick`_, `ImageMagick`_ (or `GraphicsMagick`)
44command line tools. `pgmagick`_ are python bindings for `GraphicsMagick`_
45(Magick++)`,
46
47The `ImageMagick`_ based engine ``sorl.thumbnail.engines.convert_engine.Engine``
48by default calls ``convert`` and ``identify`` shell commands. You can change the
49paths to these tools by setting ``THUMBNAIL_CONVERT`` and ``THUMBNAIL_IDENTIFY``
50respectively.  Note that you need to change these to use `GraphicsMagick`_ to
51``/path/to/gm convert`` and ``/path/to/gm identify``.
52
53Python Imaging Library installation
54-----------------------------------
55Prerequisites:
56
57- libjpeg
58- zlib
59
60Ubuntu 10.04 package installation::
61
62    sudo apt-get install libjpeg62 libjpeg62-dev zlib1g-dev
63
64Installing `Python Imaging Library`_ using pip::
65
66    pip install Pillow
67
68Watch the output for messages on what support got compiled in, you at least
69want to see the following::
70
71    --- JPEG support available
72    --- ZLIB (PNG/ZIP) support available
73
74pgmagick installation
75---------------------
76Prerequisites:
77
78- GraphicsMagick
79- Boost.Python
80
81Ubuntu 10.04 package installation::
82
83    sudo apt-get install libgraphicsmagick++-dev
84    sudo apt-get install libboost-python1.40-dev
85
86Fedora installation::
87
88    yum install GraphicsMagick-c++-devel
89    yum install boost-devel
90
91Installing `pgmagick`_ using pip::
92
93    pip install pgmagick
94
95ImageMagick installation
96------------------------
97Ubuntu 10.04 package installation::
98
99    sudo apt-get install imagemagick
100
101Or if you prefer `GraphicsMagick`_::
102
103    sudo apt-get install graphicsmagick
104
105Wand installation
106------------------------
107
108Ubuntu installation::
109
110    apt-get install libmagickwand-dev
111    pip install Wand
112
113
114.. _Python Imaging Library: http://www.pythonware.com/products/pil/
115.. _ImageMagick: http://imagemagick.com/
116.. _GraphicsMagick: http://www.graphicsmagick.org/
117.. _redis: http://code.google.com/p/redis/
118.. _redis-py: https://github.com/andymccurdy/redis-py/
119.. _Django: http://www.djangoproject.com/
120.. _Python: http://www.python.org/
121.. _pgmagick: http://bitbucket.org/hhatto/pgmagick/src
122.. _wand: http://wand-py.org
123