title: Having trouble with Django forms "OperationalError: no such table" error
body: <p>I'm trying to set up a form on Django that displays inputs on the page, but I get this error.</p>
  
  <pre><code>django.db.utils.OperationalError: no such table: firstapp_post
  </code></pre>
  
  <p>This doesn't happen right away, but when I try to use the submit feature on my form.</p>
  
  <p>Right now this is what I have as my models:</p>
  
  <pre><code>from django.db import models
  from django.contrib.auth.models import User
  
  class Post(models.Model):
      post = models.CharField(max_length=500)
      user = models.ForeignKey(User)
  </code></pre>
  
  <p>These are currently my forms: </p>
  
  <pre><code>from django import forms
  from firstapp.models import Post
  
  class IndexForm(forms.ModelForm):
      post = forms.CharField()
  
      class Meta:
          model = Post
          fields = ('post',)
  </code></pre>
  
  <p>This is my views file: </p>
  
  <pre><code>from django.shortcuts import render, redirect
  from firstapp.forms import IndexForm
  from django.views.generic import TemplateView
  
  class HomePage(TemplateView):
      template_name = 'home/home.html'
  
      def get(self, request):
          form = IndexForm()
          return render(request, self.template_name, {'form': form})
  
      def post(self, request):
          form = IndexForm(request.POST)
          if form.is_valid():
              post = form.save(commit=False)
              post.user = request.user
              post.save()
              text = form.cleaned_data['post']
              form = IndexForm()
              return redirect('home:home')
  
          args = {'form': form, 'text': text}
          return render(request, self.template_name, args)
  </code></pre>
  
  <p>This is my base.html</p>
  
  <pre><code>{% load staticfiles %}
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="UTF-8"&gt;
          &lt;title&gt;Assignment 4&lt;/title&gt;
          &lt;link rel='stylesheet' href='{% static "css/base.css" %}'/&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;p&gt;{{ variable }}&lt;/p&gt;
  
          {% block body %}{% endblock %}
  
          &lt;script src= '{% static "js/base.js" %}'&gt;&lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and my home.html:</p>
  
  <pre><code>{% extends 'base.html' %}
  
  {% block body %}
  
  &lt;div class="container"&gt;
      &lt;p&gt;Home&lt;/p&gt;
      &lt;form method="post"&gt;
          {% csrf_token %}
          {{ form.as_p }}
          &lt;button type="submit"&gt;Submit&lt;/button&gt;
      &lt;/form&gt;
      &lt;p&gt;{{ text }}&lt;/p&gt;
  &lt;/div&gt;
  
  {% endblock %}
  </code></pre>
  
  <p>Does anyone have any idea what this error even means or why I'm getting it? This has been driving me nuts. Thanks for the help!</p>