the installed apps has     'mysite.books', in the path and the html files
are in a directory under mysite project directory. Is that correct?


On Wed, Feb 1, 2012 at 12:06 PM, Ankit Rai <i.ankit....@gmail.com> wrote:

> Please check your template path in settings.py.
>
>
>
>
> On Wed, Feb 1, 2012 at 5:29 PM, TANYA <tani...@gmail.com> wrote:
>
>> In views.py, when I add this code gives template error.
>>
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
>
> *Ankit Rai*
>
> *
> *
>
> --
> 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.
>



-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to