You should put the urls.py in your application, as detailed in part 3 of the tutorial.
In your application directory create a urls.py
,
contact
- __init__.py
- views.py
- models.py
- urls.py
books
- __init__.py
- views.py
- models.py
- urls.py
In book/urls.py, add the following:
from django.conf.urls import patterns, url
from .views import search, search_form
urlpatterns = patterns('',
url(r'search-form/$', search_form, name='search_form'),
)
Then in your main urls.py
, add the following:
url(r'^books/', include('book.urls')),
Please go through the official tutorial as the django book website is out dated.