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.2.tar.gz
(182.3 kB
view details)
File details
Details for the file django-thumb-1.0.2.tar.gz.
File metadata
- Download URL: django-thumb-1.0.2.tar.gz
- Upload date:
- Size: 182.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57503b537ac58242b7f89dd4d88208abda91ebfb7b47b0749c2a092282454e49
|
|
| MD5 |
1cb1447a89de76f8010a5b87c94bc2f9
|
|
| BLAKE2b-256 |
1bf7e0b4969d240168b9c140bae72e4a58ea796314190c974703c3eddb11f7f6
|