[SOLVED]Syntax error in Django tutorial (LXF #165)

Comments, suggestions and questions about Linux Format magazine and the coverdiscs

Moderators: ChrisThornett, LXF moderators

[SOLVED]Syntax error in Django tutorial (LXF #165)

Postby bbagger » Mon Dec 17, 2012 9:13 am

When I try to create the view described on page 82 in the tutorial I get this error message:

Code: Select all
SyntaxError at /inventory

invalid syntax (views.py, line 7)

Request Method:    GET
Request URL:    http://127.0.0.1:8000/inventory
Django Version:    1.4.3
Exception Type:    SyntaxError
Exception Value:    

invalid syntax (views.py, line 7)

Exception Location:    /usr/lib/python2.7/site-packages/django/utils/importlib.py in import_module, line 35
Python Executable:    /usr/bin/python2
Python Version:    2.7.3
Python Path:    

['/home/bent/pawnstore',
 '/usr/lib/python27.zip',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7/site-packages',
 '/usr/lib/python2.7/site-packages/PIL',
 '/usr/lib/python2.7/site-packages/gst-0.10',
 '/usr/lib/python2.7/site-packages/gtk-2.0',
 '/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode']

Server time:    Mon, 17 Dec 2012 03:03:31 -0600

Line 7 of views.py is:

Code: Select all
  return render_to_response('inventory/index/html': {'latest_item_list': latest_item_list})

I have tried several alternatives within my limited Python knowledge, but have had no luck so far.

What have I done wrong?

Bent
Last edited by bbagger on Thu Feb 21, 2013 8:53 pm, edited 1 time in total.
bbagger
 
Posts: 12
Joined: Sat Apr 11, 2009 6:15 pm

Re: Syntax error in Django tutorial (LXF #165)

Postby bbagger » Thu Feb 21, 2013 8:52 pm

bbagger wrote:...
What have I done wrong?
Let me answer this myself, since nobody else can: I had ommited the comma at end of the previous line. :(
bbagger
 
Posts: 12
Joined: Sat Apr 11, 2009 6:15 pm


Return to Magazine and coverdiscs

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest