django-imaging

AJAX driven gallery field for Django
Download

django-imaging Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Jakub Nawalaniec
  • Publisher web site:
  • https://github.com/pielgrzym/

django-imaging Tags


django-imaging Description

django-imaging is an AJAX driven gallery field for Django.Quick start1. Svn checkoutsvn co http://django-imaging.googlecode.com/svn/trunk/ django-imaging2. Put "imaging" folder into your python path (easiest way: put it in your django project directory)3. Put the contents of the media folder in your project's MEDIA_ROOTMake sure the imaging_photos folder has 777 permissions4. Add "imaging" to your INSTALLED_APPS tuple in settings.py5. Include imaging in your urls.pyurlpatterns = patterns('',(...)(r'^imaging/', include('imaging.urls')),(...))Or include('myappname.imaging.urls')6. Add ImagingField? to desired modelfrom imaging.fields import ImagingFieldclass Somemodel(models.Model): photos = ImagingField()7. Optionally add a related model field for easy image fetchingfrom django.contrib.contenttypes import genericfrom imaging.fields import ImagingFieldfrom imaging.models import Imageclass Somemodel(models.Model): photos = ImagingField() photos_set = generic.GenericRelation(Image)8. Optionally add a custom imaging config to your settings.pyIMAGING_SETTINGS = {'image_sizes' : ,'image_dir' : 'funny_photos', }Above example will make django-imaging create only one thumbnail size, without forcing the aspect ratio giving the thumbnail files suffix _cus_thb. The images uploaded will be stored inside MEDIA_ROOT/funny_photos. The image_sizes list can contain an unlimited thumbnail dictionaries. You can easily access a thumbnail of an image model by an auto-created method:>>> image = Image.objects.get(pk=1)>>> image.get_my_custom_thumb_url()So basically the method name is built: get_+thumbnail_name+url()9. Syncdb to create proper imaging tables.Have fun.Product's homepage


django-imaging Related Software