title: Deposit amount using Django
body: <p>Model.py</p>
  
  <p>class Customers(models.Model):</p>
  
  <pre><code>user = models.ForeignKey(User, on_delete=models.CASCADE)
  
  contact = models.BigIntegerField(unique=True)
  
  amount = models.BigIntegerField()
  
  type = models.CharField(max_length=1)`
  </code></pre>
  
  <p>Form.py</p>
  
  <p>class Deposit_Form(forms.Form):</p>
  
  <pre><code>amount = forms.IntegerField(min_value=200, label="Enter amount u want to deposit")
  </code></pre>
  
  <p>View.py</p>
  
  <p>class Log_in(TemplateView):</p>
  
  <pre><code>template_name = 'login.html'
  
  def get(self, request, *args, **kwargs):
  
      Form = Login()
  
      return render(request, self.template_name, {'form': Form})
  
  def post(self, request):
  
      username = self.request.POST.get('username').strip()
  
      password = self.request.POST.get('password').strip()
  
      if username is None or password is None:
  
          return HttpResponse({'Doesnt exist'}, status=HTTP_400_BAD_REQUEST)
  
      user = authenticate(username=username, password=password)
  
      if not user:
  
          return HttpResponse({'Invalid candidate '}, status=HTTP_404_NOT_FOUND)
  
      return redirect('customer_menu')
  </code></pre>
  
  <p>def customer_menu(request):</p>
  
  <pre><code>if "user_id" in request.session:
  
      return render(request, 'customer_menu.html')
  </code></pre>
  
  <p>class Deposit(TemplateView):</p>
  
  <pre><code>template_name = 'deposit.html'
  
  def get(self, request, *args, **kwargs):
  
      Form = Deposit_Form()
  
      return render(request, self.template_name, {'form': Form})
  
  @staticmethod
  
  def post(request):
  
      if "user_id" in request.session:
  
          data = request.POST.get
  
          try:
  
              deposit_amount=data('deposit_amount')
  
              customer = CustomerModel(
  
                  amount = deposit_amount+amount
              )
              customer.save()
  
              return HttpResponse('action performed successfully', 500)
  
          except Exception as e:
  
              return HttpResponse("failed : {}".format(e), 200)
  </code></pre>
  
  <p>now i can't understand how can deposit amount, it show error in deposit class post function amount = deposit_amount + amount</p>