newbie with models - user-defined function raised exception

164 views
Skip to first unread message

Sami Razi

unread,
Jun 3, 2014, 7:12:19 PM6/3/14
to django...@googlegroups.com
hi,
i'm using djangobook to learn django,

when i go to localhost:8000/admin

there's no problem, also no problem with these two:

http://localhost:8000/admin/books/
http://localhost:8000/admin/books/publisher/

but going to:
http://localhost:8000/admin/books/book
gives this error:

DatabaseError at /admin/books/book/

user-defined function raised exception
Request Method: GET
Request URL: http://localhost:8000/admin/books/book/
Django Version: 1.5.5
Exception Type: DatabaseError
Exception Value:
user-defined function raised exception
Exception Location: /usr/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 362
Python Executable: /usr/bin/python
Python Version: 2.7.5
Python Path:
['/home/asedsami/djcode/mysite',
 '/usr/lib64/python27.zip',
 '/usr/lib64/python2.7',
 '/usr/lib64/python2.7/plat-linux2',
 '/usr/lib64/python2.7/lib-tk',
 '/usr/lib64/python2.7/lib-old',
 '/usr/lib64/python2.7/lib-dynload',
 '/usr/lib64/python2.7/site-packages',
 '/usr/lib64/python2.7/site-packages/gtk-2.0',
 '/usr/lib/python2.7/site-packages']
Server time: Wed, 4 Jun 2014 13:33:43 -0500
---------------------------------------------------------------------------------------------------------------------------------------------------------------





Error during template rendering

In template /usr/lib/python2.7/site-packages/django/contrib/admin/templates/admin/change_list.html, error at line 73

user-defined function raised exception

63    {% endif %}
64    {% endblock %}
65    {% if cl.formset.errors %}
66    <p class="errornote">
67    {% blocktrans count cl.formset.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
68    </p>
69    {{ cl.formset.non_form_errors }}
70    {% endif %}
71    <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
72    {% block search %}{% search_form cl %}{% endblock %}
73    {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}
74
75    {% block filters %}
76    {% if cl.has_filters %}
77    <div id="changelist-filter">
78    <h2>{% trans 'Filter' %}</h2>
79    {% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
80    </div>
81    {% endif %}
82    {% endblock %}
83

should i ask this in stackoverflow instead of here?
i don't think i never even touched the above file and i don't know what causes this error, so, thank you for you help.

Ilya Kazakevich

unread,
Jun 3, 2014, 7:22:12 PM6/3/14
to django...@googlegroups.com
You probably should not use this book for Django 1.5.

It says:
" While the book mentions Django version 1.4 in places, the vast majority of the book is for Django version 1.0"
And
" we ask that, at this time, djangobook.com not be used for educational purposes. "

Actually, you should start with Django 1.6 or even 1.7 (1.5 is outdated!) and use official Django tutorial (https://docs.djangoproject.com/en/dev/intro/tutorial01/) instead of this book.


Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"


>-----Original Message-----
>From: django...@googlegroups.com
>[mailto:django...@googlegroups.com] On Behalf Of Sami Razi
>Sent: Tuesday, June 03, 2014 11:12 PM
>To: django...@googlegroups.com
>Subject: newbie with models - user-defined function raised exception
>
>hi,
>i'm using djangobook <http://www.djangobook.com> to learn django,
>--
>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...@googlegroups.com.
>To post to this group, send email to django...@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/3eb82801-caec-4b5b-b608-0e
>7f38752885%40googlegroups.com
><https://groups.google.com/d/msgid/django-users/3eb82801-caec-4b5b-b608-0
>e7f38752885%40googlegroups.com?utm_medium=email&utm_source=footer> .
>For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages