title: How do you fix this: IntegrityError at /restaurants/create? - NOT NULL constraint failed: restaurants_restaurantlocation.name
body: <p>I'm trying to make a django developed website which is called MuyPicky. It is a website which allows you to find restaurants and other things based on your pickiness. I am currently making a page for forms which adds Restaurants to the database. As I am doing this I get this error:</p>
  
  <pre><code>IntegrityError at /restaurants/create.
  NOT NULL constraint failed: restaurants_restaurantlocation.name 
  </code></pre>
  
  <p>Is this why I get the error</p>
  
  <p>Here is the forms.py:</p>
  
  <pre><code>class RestaurantCreateForm(forms.Form):
      title = forms.CharField()
      location = forms.CharField(required = False)
      category = forms.CharField(required = False)
  </code></pre>
  
  <p>The form.html:</p>
  
  <pre><code>{% extends "base.html" %}
  
  {% block title %}Add Restaurant || {{block.super}} {% endblock %}
  
  {% block content %}
      &lt;div class="container-fluid"&gt;
          &lt;div class="container"&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-md-offset-4 col-md-4  col-md-offset-4"&gt;
                      &lt;h1&gt;Add Restaurant&lt;/h1&gt;
                      &lt;form method="POST"&gt;{% csrf_token %}
                          &lt;input title="Title" class="form-control" type="text" name="Title"    placeholder="Title"&gt;
                          &lt;br&gt;
                          &lt;input title="Location" class="form-control" type="text" name="Location" placeholder="Location"&gt;&lt;br&gt;
                          &lt;input title="Category" class="form-control" type="text" name="Category" placeholder="Category"&gt;&lt;br&gt;
                          &lt;!--&lt;input title="Save" class="form-control btn btn-info " type="submit" value="Save" &gt;--&gt;&lt;br&gt;
                          &lt;button class="btn btn-success form-control btn-md center-block" type="submit"&gt;Save&lt;/button&gt;
                          &lt;/form&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  {% endblock %}    
  </code></pre>
  
  <p>The view from views.py:</p>
  
  <pre><code>def restaurant_createview(request):
      #if request.method == "GET":
      #   print("get data")
      if request.method == "POST":
          title    = request.POST.get("title") #(request.POST["title"])
          location = request.POST.get("location")
          category = request.POST.get("category")
          obj      = RestaurantLocation.objects.create(
              name     = title,
              location = location, 
              category = category
          )
          return HttpResponseRedirect("/restaurants/")
      template_name = "restaurants/form.html"
      context = {}
      return render(request, template_name, context)
  </code></pre>
  
  <p>Lastly the urls.py:</p>
  
  <pre><code>urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^/$', TemplateView.as_view(template_name="home.html")), 
    url(r'^restaurants/$', RestaurantListView.as_view()),
    url(r'^restaurants/create/$', restaurant_createview),
    url(r'^restaurants/(?P&lt;slug&gt;[\w-]+)/$', RestaurantDetailView.as_view()),
    url(r'^contact/$', TemplateView.as_view(template_name="contact.html")),
    url(r'^about/$',TemplateView.as_view(template_name="about.html"))]
  </code></pre>