title: How to insert data in sqlite django (invalid literal for int() with base 10: 'asdf')
body: <p>I am getting the following error:</p>
  
  <blockquote>
    <p>(invalid literal for int() with base 10: 'any thing' </p>
  </blockquote>
  
  <p>I am absolutely new in Django and Python, I want to insert data in table through Django's ORM, but I can't and I tried very much to solve it but different errors comes at different stages, please help me with little explanation: </p>
  
  <p>Here is my <em>views.py</em>:</p>
  
  <pre><code>from django.shortcuts import render
  from django.http import HttpResponse, request, Http404, HttpResponseRedirect
  from django.template import Context
  from django.template.loader import get_template
  from django.contrib.auth.models import User
  from django.contrib.auth import logout
  from .models import Signup
  from django.shortcuts import render_to_response
  import sqlite3
  
  
  def first_page(request):
      username = request.GET['txtname']
      password = request.GET['txtpassword']
      contact = request.GET['txtcontact']
      address = request.GET['txtaddress']
  
      # db = sqlite3.connect('mydatabase')
      # cursor = db.cursor()
      # cursor.execute('''INSERT INTO Signup(name, password, contact, address) VALUES (?,?,?,?)''', (username, password, contact, address))
      signup = Signup(username, password, contact, address)
      signup.save()
      return render_to_response("first_page.html", {'name': username,
                                                    'password': password,
                                                    'contact': contact,
                                                    'address': address})
  
  
  def sign_up(request):
      return render_to_response("signup.html")
  </code></pre>
  
  <p>here is my models.py</p>
  
  <pre><code> from django.db import models
  
  
  class Signup(models.Model):
      name = models.CharField(max_length=200)
      password = models.CharField(max_length=50)
      contact = models.IntegerField()
      address = models.CharField(max_length=250)
  </code></pre>
  
  <p>here is my sigup.html</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Sign Up Form&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form action="." method="get"&gt;
  
          &lt;label for="txtname"&gt;Name&lt;/label&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
          &lt;input type="text" id="txtname" name="txtname"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
  
          &lt;label for="txtpassword"&gt;Password&lt;/label&gt;&amp;nbsp;&amp;nbsp;
          &lt;input type="password" id="txtpassword" name="txtpassword"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
  
          &lt;label for="txtcontact"&gt;Contact&lt;/label&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
          &lt;input type="number" id="txtcontact" name="txtcontact"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
  
          &lt;label for="txtaddress"&gt;Address&lt;/label&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
          &lt;input type="text" id="txtaddress" name="txtaddress"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
  
          &lt;input type="submit" id="btnsignup" name="btnsignup" value="Register"&gt;
  
      &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>here is my urls.py</p>
  
  <pre><code>from django.conf.urls import url
  from django.contrib import admin
  from reg.views import *
  
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^first/', first_page),
      url(r'^register$', sign_up),
      url(r'^$', first_page),
  ]
  </code></pre>