On May 31, 9:56 am, andrew_dunn <andrewmd...@gmail.com> wrote: > I'm trying to run a script to import data to my model. All the field > names are correct. What I'm getting is an error message that says my > syntax is incorrect on the line that says "for row in reader:" It says > the error is on the colon. If I remove the colon, it gives a syntax > error on the last "e" on "restaurant_name = row[0]" Here's the code: > > import sys > from django.core.management import setup_environ > sys.path.append('C:\django') > from mysite import settings > setup_environ(settings) > > from mysite.mealfinder.models import Restaurant > > import csv > reader = csv.reader(open("mysite\restaurants.csv")
Here's the error - you didn't close the outermost bracket. If Python gives you a syntax error, it's always worth checking on the line *before* the one it flags up. -- DR. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---