title: Python/Django: How to render user-submitted videos code fragments as embedded videos?
body: <p>I want to enable users to submit video links in a post/comment and render it as embedded videos.</p>
  
  <p>For example, youtube supplies code for embedding videos, something like:</p>
  
  <pre><code>&lt;iframe width="420" height="345" src="http://www.youtube.com/embed/Rr6PWlOgPrs" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>If a user puts the above code fragment in a comment, how do I render it correctly? </p>
  
  <p>Django auto-escapes all HTML tags, so by default the above code wouldn't work. But if I disable auto-escaping then I'd open a ton of security risks.</p>
  
  <p>What's the best way of handling this?</p>