def search(request): error = False if 'q' in request.GET: q = request.GET['q'] if not q: error = True else: books = Book.objects.filter(title__icontains=q) return render_to_response('search_results.html', {'books': books, 'query': q}) return render_to_response('search_form.html', {'error': error})I have created search_form.html and search.html and put it in "template" directory but get this error ,
TemplateDoesNotExist at /search/
search_form.html
Request Method: | GET |
---|---|
Request URL: | http://127.0.0.1:8000/search/ |
Django Version: | 1.3.1 |
Exception Type: | TemplateDoesNotExist |
Exception Value: | search_form.html |
Exception Location: | /usr/local/lib/python2.6/dist-packages/django/template/loader.py in find_template, line 138 |
Python Executable: | /usr/bin/python |
--
TANYA
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment