Every time I edit a model and run syncdb, I get a database error telling me that the column doesn't exist.
#Error Message:Environment:
Request Method: GET
Request URL:
http://127.0.0.1:8000/tickets/2/
Django Version: 1.4
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'tickets',
'django.contrib.admin')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in view
48. return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in dispatch
69. return handler(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/detail.py" in get
98. self.object = self.get_object()
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/detail.py" in get_object
49. obj = queryset.get()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in get
361. num = len(clone)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in __len__
85. self._result_cache = list(self.iterator())
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in iterator
291. for row in compiler.results_iter():
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py" in results_iter
763. for rows in self.execute_sql(MULTI):
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py" in execute_sql
818. cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py" in execute
40. return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py" in execute
52. return self.cursor.execute(query, args)
Exception Type: DatabaseError at /tickets/2/
Exception Value: column tickets_ticket.picture does not exist
LINE 1: ...icket"."description", "tickets_ticket"."ranking", "tickets_t...
^
I also noticed that when I run syncdb, It tells me that no new objects were installed.
But when i do python manage.py sql tickets, I get all my objects.
#python mange.py sql ticketsBEGIN;
CREATE TABLE "tickets_ticket" (
"id" serial NOT NULL PRIMARY KEY,
"title" varchar(100) NOT NULL,
"date_created" timestamp with time zone NOT NULL,
"description" text NOT NULL,
"ranking" integer CHECK ("ranking" >= 0) NOT NULL,
"picture" varchar(100) NOT NULL
)
;
COMMIT;
Is there a step I'm missing? I never had this problem while using sqlite, only in postgresql.
Any help is very much appreciated.