Solution here:
http://stackoverflow.com/questions/19699136/python-django-tangowithdjango-models-and-databases
On Wednesday, June 4, 2014 2:01:44 PM UTC+4, Srinivasulu Reddy wrote:
>
> Hello Folks,
>I am learning tangowithdjango book . In chapter 5 while dealing
> the Populated Script i am getting this error . Please any one can help me
> on this
>
> (mysite)seenu@acer:~/django_projects/seenu/tango_django$ python
> populate_rango.py
>
> Starting Rango population script...
> Traceback (most recent call last):
> File "populate_rango.py", line 60, in
> populate()
> File "populate_rango.py", line 4, in populate
> python_cat = add_cat('Python', views=128, likes=64)
> File "populate_rango.py", line 52, in add_cat
> c =
> Category.objects.get_or_create(name=name,views=views,likes=likes)[0]
> File
> "/home/seenu/.virtualenvs/mysite/local/lib/python2.7/site-packages/django/db/models/manager.py",
>
> line 134, in get_or_create
> return self.get_query_set().get_or_create(**kwargs)
> File
> "/home/seenu/.virtualenvs/mysite/local/lib/python2.7/site-packages/django/db/models/query.py",
>
> line 445, in get_or_create
> return self.get(**lookup), False
> File
> "/home/seenu/.virtualenvs/mysite/local/lib/python2.7/site-packages/django/db/models/query.py",
>
> line 361, in get
> num = len(clone)
> File
> "/home/seenu/.virtualenvs/mysite/local/lib/python2.7/site-packages/django/db/models/query.py",
>
> line 85, in __len__
> self._result_cache = list(self.iterator())
> File
> "/home/seenu/.virtualenvs/mysite/local/lib/python2.7/site-packages/django/db/models/query.py",
>
> line 291, in iterator
> for row in compiler.results_iter():
> File
> "/home/seenu/.virtualenvs/mysite/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
>
> line 763, in results_iter
> for rows in self.execute_sql(MULTI):
> File
> "/home/seenu/.virtualenvs/mysite/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
>
> line 818, in execute_sql
> cursor.execute(sql, params)
> File
> "/home/seenu/.virtualenvs/mysite/local/lib/python2.7/site-packages/django/db/backends/util.py",
>
> line 40, in execute
> return self.cursor.execute(sql, params)
> File
> "/home/seenu/.virtualenvs/mysite/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
>
> line 114, in execute
> return self.cursor.execute(query, args)
> File
> "/home/seenu/.virtualenvs/mysite/local/lib/python2.7/site-packages/MySQLdb/cursors.py",
>
> line 205, in execute
> self.errorhandler(self, exc, value)
> File
> "/home/seenu/.virtualenvs/mysite/local/lib/python2.7/site-packages/MySQLdb/connections.py",
>
> line 36, in defaulterrorhandler
> raise errorclass, errorvalue
> django.db.utils.DatabaseError: (1054, "Unknown column
> 'rango_category.views' in 'field list'")
>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/9d461284-340b-4487-b392-61ef374e05db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.