Fields for previewing image and video uploaded files
pip install django-filepreviewfields
- To use file preview fields, you have to add it to your INSTALLED_APPS on your project's settings.py so the needed static files can be loaded:
INSTALLED_APPS = (
...
'filepreviewfields',
)
- To use SortedManyToMany field, just create a field as if you were adding the default ManyToMany
from django.db import models
from filepreviewfields.fields import ImagePreviewField, VideoPreviewField
class Movie(models.Model):
...
cover = ImagePreviewField()
video = VideoPreviewField()
MIT