Source

django-generic-images / docs / index.rst

django-generic-images's documentation

django-generic-images is a generic images pluggable django app.

This app provides image model (useful managers, methods and fields) that can be attached to any other Django model using generic relations. It also provides admin multi-image uploader (based on GearsUploader ) with client-side image resizing, animated progress bar and before-upload image previews.

Requirements: django 1.1 (or trunk).

django-composition is required if you want to use :class:`~generic_images.fields.ImageCountField` or :class:`~generic_images.fields.UserImageCountField`.

There is an image gallery app (django-photo-albums) based on django-generic-images.

Installation

$ pip install django-generic-images

or:

$ easy_install django-generic-images

or:

$ hg clone http://bitbucket.org/kmike/django-generic-images/
$ cd django-generic-images
$ python setup.py install

Then add 'generic_images' to your INSTALLED_APPS in settings.py and run

$ manage.py syncdb

If you want ImageCountField and UserImageCountField then follow installation instructions at http://bitbucket.org/daevaorn/django-composition/ to install django-composition.

For admin uploader to work generic_images folder from generic_images/media/ should be copied to project's MEDIA_ROOT.

Usage

Generic Images

The idea is to provide an infrastructure for images that can be attached to any django model using generic relations.

Models

Admin

Managers

Forms

Fields for denormalisation

Context processors

Generic Utils

Pluggable app utils

Models

Generic relation helpers

Template tag helpers

Test helpers