Skip to main content

A simple Django model fields to generate images from videos or write on images

Project description

=====
django-thumb
=====

django-thumb is a simple Django app contains 2 models fields
to generate images from videos and write on images

Visit the github repo https://github.com/AmrAnwar/django-thumb for more info.

Quick start
-----------

1. Add "thumb" to your INSTALLED_APPS setting like this::

INSTALLED_APPS = [
...
'thumb',
]

2. Add the STATIC_ROOT, MEDIA_ROOT and MEDIA_URL in setting like:
STATIC_ROOT = os.path.join(BASE_DIR, "static")
MEDIA_ROOT = 'media'
MEDIA_URL = '/media/'

3. Add the MEDIA path to your urlpatterns in urls.py like:
...
from django.conf.urls.static import static
from django.conf import settings

urlpatterns = [
...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

3. Run `python manage.py collectstatic ` to create the static fields in your root.

4. now you can use the app model fields like:
from thumb import ImageThumbnailField, VideoThumbnailField

5. in VideoThumbnailField you have to give the video field name if it's not named as `video`:
my_video = models.FileField()
thumb = VideoThumbnailField(video_field_name="my_video")

6. test the Thumbnail Fields in the admin page http://127.0.0.1:8000/admin/


### Visit https://github.com/AmrAnwar/django-thumb for more info.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-thumb-1.0.2.tar.gz (182.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page