Ajax driven gallery field for django admin
[Screenshot] 1
After 2 years of slumber brought to life again
- Django >= 1.2
- Django Imagekit >= 1.0.0
- Python PIL
- Install imaging using easy_install or pip
pip install django-imaging
-
Put the contents of the media folder in your project's MEDIA_ROOT. Make sure the imaging_photos folder has 777 permissions.
-
Add "imaging" to your INSTALLED_APPS tuple in settings.py
-
Include imaging in your urls.py
urlpatterns = patterns('',
(...)
(r'^imaging/', include('imaging.urls')),
(...)
)
Or include('myappname.imaging.urls')
- Add ImagingField to desired model
from imaging.fields import ImagingField
class Somemodel(models.Model):
photos = ImagingField()
- Optionally add a related model field for easy image fetching
from django.contrib.contenttypes import generic
from imaging.fields import ImagingField
from imaging.models import Image
class Somemodel(models.Model):
photos = ImagingField()
photos_set = generic.GenericRelation(Image)
- Optionally add a custom imaging config to your settings.py
IMAGING_SETTINGS = {
'image_dir' : 'funny_photos',
}
The images uploaded will be stored inside MEDIA_ROOT/funny_photos.
- Syncdb to create proper imaging tables.
- Currently only one ImagingField? per model.
- Drag'n'drop doesn't work properly in Opera (jquery.ui.sortable related problem)
- No orphaned images management
- ManyToMany? relation with an Image not supported
- Need to add a GenericRelation? field manually, I can't figoure out how to autoadd it
- Exceptions not handled too well