Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/20tab/twentytab-image-ui
A django app that implements an admin to have thumbnails with colorbox.js
https://github.com/20tab/twentytab-image-ui
Last synced: 20 days ago
JSON representation
A django app that implements an admin to have thumbnails with colorbox.js
- Host: GitHub
- URL: https://github.com/20tab/twentytab-image-ui
- Owner: 20tab
- License: mit
- Created: 2014-02-09T18:10:36.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-13T18:50:36.000Z (about 10 years ago)
- Last Synced: 2024-11-22T09:41:33.235Z (about 2 months ago)
- Language: JavaScript
- Size: 533 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
twentytab-image-ui
==================A django app that implements an admin to have thumbnails with colorbox.js
## Installation
Use the following command: pip install twentytab-image-ui
## Configuration
Run collectstatic command or map static directory.
## Usage
- models-py
```py
from django.db import models
from imagekit.processors import ResizeToFill
from imagekit.models import ImageSpecFieldclass ModelTest(models.Model):
image = models.ImageField(upload_to='your_media_path')
thumb = ImageSpecField(
source='image',
processors=[ResizeToFill(50, 50)],
format='JPEG',
options={'quality': 99}
)```
- admin.py
```py
from django.contrib import admin
from testapp.models import ModelTest
from image_ui.admin import AdminThumbnail, ColorBoxAdminclass ModelTestAdmin(ColorBoxAdmin):
admin_thumbnail = AdminThumbnail(image_field='thumb', original_image='image')list_display = (..., 'admin_thumbnail', ...)
admin.site.register(ModelTest, ModelTestAdmin)
```