title: How do i push uploaded image file in my template input for update in django 2.0
body: <p>I want to open a particular record in html template in update mode for which i want every value which was inserted before for this record be in those field, i got every required value in field for text field but in file field which contains image ,it shows no file selected where as i want the image file name(url) in there.</p>
  
  <p>I havent used django form rather i used normal bootstrap forms.</p>
  
  <p>models.py</p>
  
  <pre><code>from django.db import models
  from django.contrib.auth.models import User
  
  class Product(models.Model):
      title = models.CharField(max_length=255)
      pub_date = models.DateTimeField()
      body = models.TextField()
      image = models.ImageField(upload_to='images/')   # i m facing problem for this field
      icon = models.ImageField(upload_to='images/')   # i m facing problem for this field as well 
      url = models.TextField()
      votes_total = models.IntegerField(default=1)
      hunter = models.ForeignKey(User,on_delete=models.CASCADE)
  
      def __str__(self):
          return self.title
      def summary(self):
          return self.body[:100]
      def short_pub_date(self):
          return self.pub_date.strftime('%b %e %Y')
  </code></pre>
  
  #
  
  <p>views.py</p>
  
  <pre><code>def myproducts_update(request,product_id):
      product = get_object_or_404(Product,pk=product_id)
      print(product.image)          # this prints the name of the file (images/37003.jpeg)
      return render(request,'products/myproducts_update.html',{'product':product})
  </code></pre>
  
  <p>templates(myproducts_update.html)</p>
  
  <pre><code>{% extends 'base.html' %}
  
  {% block content %}
  {% if error %}
  {{error}}
  
  {% endif %}
  &lt;br&gt;
  &lt;br&gt;
  &lt;div class="container"&gt;
    &lt;div class="jumbotron"&gt;
  
      &lt;h2&gt;Update Product&lt;/h2&gt;
    &lt;form action="{% url 'create' %}" method="POST" enctype="multipart/form-data"&gt;
      {% csrf_token %}
      &lt;div class="form-group"&gt;
        &lt;label for="title"&gt;Title:&lt;/label&gt;
        &lt;input type="text" class="form-control" id="email" value={{product.title}} placeholder="please enter title" name="title" required&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
        &lt;label for="body"&gt;Description:&lt;/label&gt;
        &lt;input type="text" class="form-control" id="body" value={{product.body}} placeholder="Description" name="body" required&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
        &lt;label for="url"&gt;URL:&lt;/label&gt;
        &lt;input type="text" class="form-control" id="url" value={{product.url}} placeholder="please enter url" name="url" required&gt;
      &lt;/div&gt;
      &lt;br&gt;
      &lt;div class="row"&gt;
        &lt;div class="col-sm-6"&gt;
          &lt;div class="form-group"&gt;
            &lt;label for="icon"&gt;
              &lt;strong&gt;Icon:&lt;/strong&gt;&lt;/label&gt;
            &lt;input type="file"  id="icon"  name="icon" value={{product.icon}} required&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="col-sm-6"&gt;
          &lt;div class="form-group"&gt;
            &lt;label for="url"&gt;
              &lt;strong&gt;Image:&lt;/strong&gt;&lt;/label&gt;
            &lt;input type="file"  id="image" placeholder="please enter url" name="image" value={{product.image}} required&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;br&gt;
  
  
      &lt;input type="submit" value="Update Product" class="btn btn-primary"&gt;
  
    &lt;/form&gt;
  
  
  
  
  
    &lt;/div&gt;
  &lt;/div&gt;
  
  {% endblock %}
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/nnZAO.jpg" rel="nofollow noreferrer">Link which contains image of form where i have problem</a></p>
  
  <p>I am having trouble in getting the url of the image in the templates,guys please help me</p>
  
  <p>Thanks in advance!</p>