0

I'm having a frustrating time installing a very simple recipes website for myself using Django. Everything has been going fine until I attempt to set up my urls.py, which reads:

from django.conf.urls.defaults import *
from django.contrib import admin
from timsrecipes.recipes import views
admin.autodiscover()


urlpatterns = patterns('',
      (r'^index/$', views.index),
      (r'^search/$',views.search),
      (r'^ingredientsearch/$', views.ingredientsearch),
      (r'^admin/', include(admin.site.urls)),
)

The database containing the recipes has been set up, validated, and synchronized, but when I attempt to access any of the webpages, I get the following error message:

Exception Value: ('invalid syntax', ('/Users/mary/Programming-Startup/timsrecipes/../timsrecipes/recipes/views.py', 13, 10, ' )\n'))

Exception Location: /Users/mary/Programming-Startup/timsrecipes/../timsrecipes/urls.py in , line 3

I really cannot see what the syntax error is here. Several other small websites I've built have this same formula for importing their views, so I cannot understand what the problem could be.

1
  • Your error is in views.py. Give us it's source code. Commented Mar 16, 2011 at 22:25

1 Answer 1

4

The exception is not in urls.py, it's in recipes/views.py, line 13.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.