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.
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
Release history Release notifications | RSS feed
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.0.tar.gz
(182.3 kB
view hashes)
Built Distribution
django_thumb-1.0.0-py3-none-any.whl
(192.1 kB
view hashes)
Close
Hashes for django_thumb-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7ec48cdc1715014eb5c49efbf0f9509a3d7f2e800e75a3baff9d128ebce17b4 |
|
MD5 | f353f36c804ac3cd4c401d1c7ef7d766 |
|
BLAKE2b-256 | ec40787b4862fc9a0c0a3988eaee2997d0da165152d4ad86007585c42b9f4ded |