The simpliest way is to use pip to install package:
pip install django-embed-video
If you want latest version, you may use Git. It is fresh, but unstable.
pip install git+https://github.com/jazzband/django-embed-video
Add embed_video
to :py~django.settings.INSTALLED_APPS
in your Django settings.
INSTALLED_APPS = (
...
'embed_video',
)
To detect HTTP/S you must use :py~django.template.context_processors.request
context processor:
TEMPLATE_CONTEXT_PROCESSORS = (
...
'django.template.context_processors.request',
)
- Add
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
to your settings.py - Add
proxy_set_header X-Forwarded-Proto $scheme;
to your Nginx site config file.
This will set request.is_secure()
equal to true when it is checked by embed_video_tags.py
, for more information reffer here.