Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#2571 closed defect (invalid)

SyntaxError working through "writing 1st django app pt 1" tutorial

Reported by: since1968 Owned by: Adrian Holovaty
Component: Core (Other) Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Working through the tutorial ( I get a syntax error when I run the following line: python sql polls. I named the project "tutorial" instead of "mysite" but other than that everything is the same. I copied and pasted the model code.

I'm using the development version downloaded from svn. I'm on OS X and my database is MySQL. The error message, in full:

towy:~/sites/django/tutorial marc$ python sql polls
Traceback (most recent call last):

File "", line 11, in ?


File "/usr/local/lib/python2.4/site-packages/django/core/", line 1343, in execute_manager

execute_from_command_line(action_mapping, argv)

File "/usr/local/lib/python2.4/site-packages/django/core/", line 1294, in execute_from_command_line

mod_list = [models.get_app(app_label) for app_label in args[1:]]

File "/usr/local/lib/python2.4/site-packages/django/db/models/", line 40, in get_app

mod = load_app(app_name)

File "/usr/local/lib/python2.4/site-packages/django/db/models/", line 51, in load_app

mod = import(app_name, , , models?)

File "/Users/marc/Sites/django/tutorial/../tutorial/polls/", line 10

votes models.IntegerField()

SyntaxError: invalid syntax

Change History (3)

comment:1 Changed 13 years ago by since1968

sorry, meant to include the email for follow up: marc at since1968 dot com.

comment:2 Changed 13 years ago by Adrian Holovaty

Resolution: invalid
Status: newclosed

You have a syntax error in your file. I suspect you want this:

votes = models.IntegerField()

comment:3 Changed 13 years ago by since1968

Thanks for the quick response. Apologies for my error.

Note: See TracTickets for help on using tickets.
Back to Top