i want to create a video from youtube url in the django using embed-video
1.step install embed-video
pip install django-embed-video
- step
Add embed_video to INSTALLED_APPS in your Django settings.
TEMPLATE_CONTEXT_PROCESSORS = (
...
'django.core.context_processors.request',
)
3.step my model.py
from django.db import models
from embed_video.fields import EmbedVideoField
class Item(models.Model):
video = EmbedVideoField() # same like models.URLField()
4.step admin .py
class MyModelAdmin(AdminVideoMixin, admin.ModelAdmin):
pass
admin.site.register(MyModelAdmin)
5.step html tags
{% load embed_video_tags %}
the video tag:
{% video item.video as my_video %}
URL: {{ my_video.url }}
Thumbnail: {{ my_video.thumbnail }}
Backend: {{ my_video.backend }}
{% video my_video "large" %}
{% endvideo %}
in the 5 step show me error Unresolved tag 'video'
why have error ? i follow the docs embed-video