title: Editing the Form in Django creates new instance
body: <p>I am editing the form , it loads data correctly buy when i hit save it creates new entry in database.</p>
  
  <p>Here is the view functions </p>
  
  <pre><code>def create_account(request):
  
  
      if request.method == 'POST': # If the form has been submitted...
          form = AccountForm(request.POST, request.FILES) # A form bound to the POST data
          if form.is_valid(): # All validation rules pass
                  form.save()
                  return HttpResponseRedirect('/thanks/') # Redirect after POST
      else:
          form = AccountForm() # An unbound form
  
      return render_to_response('account_form.html', {
              'form': form,
      })
  </code></pre>
  
  <p>--</p>
  
  <pre><code>def edit_account(request, acc_id):
  
      f = Account.objects.get(pk=acc_id)
      if request.method == 'POST': # If the form has been submitted...
          form = AccountForm(request.POST, request.FILES) # A form bound to the POST data
          if form.is_valid(): # All validation rules pass
                  form.save()
                  return HttpResponseRedirect('/thanks/') # Redirect after POST
      else:
          form = AccountForm(instance=f) # An unbound form
  
      return render_to_response('account_form.html', {
              'form': form,
      })
  </code></pre>
  
  <p>Do i really need to have separate function of editing and separate for deleting. Can i do all in one function</p>
  
  <p>template</p>
  
  <pre><code>    &lt;form action="/account/" method="post" enctype="multipart/form-data" &gt;
      {% csrf_token %}
      {% for field in form %}
          &lt;div class="fieldWrapper"&gt;
              {{ field.errors }}
              {{ field.label_tag }}: {{ field }}
          &lt;/div&gt;
      {% endfor %}
      &lt;p&gt;&lt;input type="submit" value="Send message" /&gt;&lt;/p&gt;
      &lt;/form&gt;
  </code></pre>