django-exposure
===============
django-exposure provides a mechanism for resizing photos and streaming the resulting data as an HTTP response. It avoids the need to store the resized files on disk and assumes that you are using upstream cache.
.. toctree::
:maxdepth: 2
:hidden:
changelog
.. comment: split here
Installation
************
To install the latest release (currently 1.0.5) using pip::
pip install django-exposure
To install the development version from github using pip::
pip install -e git://github.com/natgeo/django-exposure.git
Add ``exposure`` to ``INSTALLED_APPS``::
INSTALLED_APPS = (
...
'exposure',
...
)
Usage
*****
Add the following to your project's settings.py file::
EXPOSURE_MAX_HEIGHT = 1000
EXPOSURE_MAX_WIDTH = 1000
EXPOSURE_EXPIRE_SECS = 3600
Then access your files as you normally would through templates::
For example, the following will yield a 200x200 version of your image, cropped::
You can also use an alternate syntax for resize dimensions::
Tests
*****
To run the tests, add ``exposure`` to your ``INSTALLED_APPS`` and run::
django-admin.py test exposure
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`