Having error null value in column "publicatithon_date" violates not-null constraint in django
<p>Hello I'm new to django and I'm learning django with this book:
djangobook.com
and I stuck in chapter 5 &amp; 6 because when I try to check my work(in <a href="http://127.0.0.1:8000/admin/books/book/add/" rel="nofollow">http://127.0.0.1:8000/admin/books/book/add/</a>) I get some errors and I was trying to fix those errors and after that they gone but I got a new error and I tried to figure out how to solve it but I still don't know how.
This is my error:</p>

<blockquote>
  <p>IntegrityError at /admin/books/book/add/</p>
  
  <p>null value in column "publicatithon_date" violates not-null constraint</p>
</blockquote>

<p>And you can see all of my codes here:
<a href="https://github.com/Anahitahf/mysite2" rel="nofollow">https://github.com/Anahitahf/mysite2</a></p>

<p>How can I solve this error?
Thanks in advance for any feedbacks.</p>

<p>As the error states, the publication_date is a not-null field and you're trying to add a Book with publication_date not set.<br>
One option to fix that is to make publication_date accept null values in your models.py thus:  </p>

<pre><code>publication_date = models.DateField(null=true,)
</code></pre>

<p>However, I think that the issue is being caused as you're trying to reload the page?? Anyhow, try to go back to the admin page and then try to create a new Book again. The error should not happen then. If it does, then you can set the null property of publication_date as true.</p>

<p><strong>edit:</strong><br>
Going through your models you don't have a "publicatithon_date" field in them. Maybe you created that field by mistake and removed it from your model after making a migrations?? You should do the following in your terminal:</p>

<pre><code>$ python manage.py dbshell 

$ mysql&gt; | psql&gt; ALTER TABLE table_name DROP column publicatithon_date;

$ python manage.py syncdb
</code></pre>

<p>And it will drop the wrong field from the table.</p>

python django