Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#2571 closed defect (invalid)

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

Reported by: since1968 Owned by: adrian
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: UI/UX:

Description

Working through the tutorial (http://www.djangoproject.com/documentation/tutorial1/) I get a syntax error when I run the following line: python manage.py 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 manage.py sql polls
Traceback (most recent call last):

File "manage.py", line 11, in ?

execute_manager(settings)

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

execute_from_command_line(action_mapping, argv)

File "/usr/local/lib/python2.4/site-packages/django/core/management.py", 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/loading.py", line 40, in get_app

mod = load_app(app_name)

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

mod = import(app_name, , , models?)

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

votes models.IntegerField()


SyntaxError: invalid syntax

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by since1968

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

comment:2 Changed 8 years ago by adrian

  • Resolution set to invalid
  • Status changed from new to closed

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

votes = models.IntegerField()

comment:3 Changed 8 years ago by since1968

Thanks for the quick response. Apologies for my error.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.