I changed the attribute of one of my model fields and git-pulled the update. After the update, this error appeared every time I tried to access the database from my website:
OperationalError at /admin/blog/post/
no such column: blog_post.Day
Request Method: GET
Request URL: http://cqcum6er.pythonanywhere.com/admin/blog/post/
Django Version: 1.8.2
Exception Type: OperationalError
Exception Value: no such column: blog_post.Day
Exception Location: /home/cqcum6er/my-first-blog/myvenv/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 318
Python Executable: /usr/local/bin/uwsgi
Python Version: 2.7.6
Python Path: ['/var/www',
'.',
'',
'/var/www',
'/home/cqcum6er/my-first-blog/myvenv/lib/python2.7',
'/home/cqcum6er/my-first-blog/myvenv/lib/python2.7/plat-x86_64-linux-gnu',
'/home/cqcum6er/my-first-blog/myvenv/lib/python2.7/lib-tk',
'/home/cqcum6er/my-first-blog/myvenv/lib/python2.7/lib-old',
'/home/cqcum6er/my-first-blog/myvenv/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/home/cqcum6er/my-first-blog/myvenv/local/lib/python2.7/site-packages',
'/home/cqcum6er/my-first-blog/myvenv/lib/python2.7/site-packages',
'/home/cqcum6er/my-first-blog']
Server time: Fri, 25 Nov 2016 19:46:45 +0000
I ran the syncdb command, but the following error showed up:
23:02 ~/my-first-blog (master)$ python manage.py syncdb
Creating tables ...
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 429, in execut
e_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 379, in execut
e
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 191, in run_from_a
rgv
self.execute(*args, **options.__dict__)
self._result_cache = list(self.iterator())
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 109, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
interactive=interactive, db=db)
File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/management/__init__.py", line 30, in create_permissions
ctype = ContentType.objects.get_for_model(klass)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/contenttypes/models.py", line 38, in get_for_model
defaults = {'name': smart_unicode(opts.verbose_name_raw)},
File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 135, in get_or_create
return self.get_query_set().get_or_create(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 378, in get_or_create
return self.get(**lookup), False
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 344, in get
num = len(clone)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 82, in __len__
self._result_cache = list(self.iterator())
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 273, in iterator
for row in compiler.results_iter():
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 680, in results_iter
for rows in self.execute_sql(MULTI):
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 735, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 34, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py", line 234, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.DatabaseError: no such column: django_content_type.name
Does anyone know how to correct this? I ran my project locally , and it ran without a problem. Nothing besides models.py and views.py were modified for my update.