开发者

Syntax Error in Django urls.py

开发者 https://www.devze.com 2023-02-18 10:18 出处:网络
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:

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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消