title: Django Admin Inline FileField link to open in new tab
body: <p>I have fieldfields in an inline in Django Admin.   The link to the file works fine and the uploaded file is shown in browser. Now i want to make the link open in a new tab. I imagine the quickest way is to insert a target="_blank" into the html, but there seems to be no template for it - maybe it's generated by python code. Can you please help me pinpoint where to inject?</p>
  
  <p>models.py:</p>
  
  <pre><code>class Anhang(models.Model):
     antrag = models.ForeignKey(Antrag)
     upload = models.FileField(upload_to=subfolderpath)
  </code></pre>
  
  <p>admin.py:</p>
  
  <pre><code>class AnhangInline(admin.TabularInline):
     model = Anhang
     extra = 0
     show_change_link = False
  </code></pre>
  
  <p>In Admin:</p>
  
  <p><a href="https://i.stack.imgur.com/iXIqD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iXIqD.png" alt="enter image description here"></a></p>
  
  <p>Thank you very much.   </p>
  
  <p><strong>Solution, thanks to @JulienS:</strong><br>
  1. Override the template in your app:<br>
      django/contrib/admin/templates/admin/widgets/clearable_file_input.html<br>
  2. Insert in template:<br>
      <code>&lt;a target="_blank" href="{{ widget.value.url }}"&gt;</code></p>