title: validate FileFiled URL in django
body: <p>I have a upload view:</p>
  
  <p>views.py</p>
  
  <pre><code>def upload(request):
  
       if request.method == 'POST':
              form = DocumentForm(request.POST, request.FILES)
              if form.is_valid():
                  newdoc = Document(docfile = request.FILES['docfile'])
                  newdoc.save()
  
                  # Redirect to the document list after POST
                  return HttpResponseRedirect(reverse('wiki.views.upload'))
          else:
              form = DocumentForm() # A empty, unbound form
  
          # Load documents for the list page
          documents = Document.objects.all()
  
          return render_to_response(
              'wiki/upload.html',
              {'documents': documents, 'form': form},
              context_instance=RequestContext(request)
          )
  </code></pre>
  
  <p>and my template
  upload.html</p>
  
  <pre><code>{%extends "base.html"%}
  
  {%block title%}Upload Documents{%endblock%}
  
  {%block content%}
      &lt;!-- List of uploaded documents --&gt;
      {% if documents %}
          &lt;ul&gt;
          {% for document in documents %}
              &lt;a href="{{ document.docfile.url }}"&gt;{{ document.docfile.name }}&lt;/a&gt;
          {% endfor %}
          &lt;/ul&gt;
      {% else %}
          &lt;p&gt;No documents.&lt;/p&gt;
      {% endif %}
  
      &lt;!-- Upload form. Note enctype attribute! --&gt;
      &lt;form action="{% url upload %}" method="post" enctype="multipart/form-data"&gt;
          {% csrf_token %}
          {{ form.non_field_errors }}
          {{ form.docfile.help_text }}
          {{ form.docfile.label_tag }}
          {{ form.docfile.errors }}
          {{ form.docfile }}
          &lt;input type="submit" value="Upload" /&gt;
      &lt;/form&gt;
  
  {%endblock%}
  </code></pre>
  
  <p>I am uploading some files at the specified location under {MEDIA_ROOT} and it shows on the server but if I delete the file from that folder, the file name still shows on the webpage.</p>
  
  <p>How do I validate and then display the uploaded file using my template.</p>