About Links with target=_blank
If you need to use a link that should open in a new window with target="_blank"
, always add rel="noopener noreferrer"
to it:
<a href="{{ url }}" target="_blank" rel="noopener noreferrer">
{{ title }}
</a>
Otherwise the linked website can modify your website's window
object by JavaScript.
Tips and Tricks Development Security Django 4.2 Django 3.2 Django 2.2 JavaScript HTML5
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.