[Django]-Python/Django: How to render user-submitted videos code fragments as embedded videos?

1👍

What I do on my site is have users submit a link to the YouTube video. No embed stuff, just the link. Then I use the oEmbed API to ask YouTube for the embed HTML code for the given link. If you trust YouTube, you can then use the HTML they give you without escaping it.

I’ve been doing this for 6 months now, it works really great.

3👍

The user should never be able to insert HTML directly. Look into django-oembed.
This way the user will only have to paste in the URL and oembed will match it and switch the matched urls automatically with object embed code.

1👍

Give a try to django-embed-video. It is quite simple.

Leave a comment