Well, after inserting a number of debugging statements in loader.py
and filesystem.py, I found the cause of this; here's what the
filesystem.py Loader's load_template_source attempts to access:

filepath=u'/cygdrive/d/django-projects/localsite/D:/django-projects/
localsite/templates/polls/index.htm'

So if you're using windows and have python installed through cygwin,
you have to edit the loader files a bit. By the way, I also have
python installed outside of cygwin and never realized that django
decided to use the cygwin python directory... I'm not sure if that can
be changed and how. Thoughts?



On Jun 5, 4:16 pm, elysianfields <elysian.field...@gmail.com> wrote:
> I did see a very similar post in this group, but it did not help me
> with my problem. I'm probably overlooking something simple, this is
> what I have:
>
> # SETTINGS.PY:
> TEMPLATE_DIRS = (
>     "D:/django-projects/localsite/templates",
> )
>
> # POLLS/VIEWS.PY:
> from django.http import HttpResponse
> from localsite.polls.models import Poll
> from django.template import Context, loader
>
> def index(request):
>     latest_polls = Poll.objects.all().order_by('-pub_date')[:5]
>     t = loader.get_template('polls/index.htm')
>     c = Context({
>         'latest_polls': latest_polls,
>     })
>     return HttpResponse(t.render(c))
>
> THE FOLDER STRUCTURE:
> D:\django-projects\localsite\templates\polls\index.htm
>
> Notes:
> - I also tried editing the admin template by creating D:\django-
> projects\localsite\templates\admin\base_site.html but changing that
> template did not affect the admin interface either.
> - I am running this on the django development server. The
> TemplateDoesNotExist error page is a result of trying to 
> accesshttp://localhost:8000/polls/
> - More info from the error page:
>
> Request Method:         GET
> Request URL:            http://localhost:8000/polls/
> Django Version:         1.2.1
> Exception Type:         TemplateDoesNotExist
> Exception Value:        polls/index.htm
> Exception Location:     /usr/lib/python2.5/site-packages/django/template/
> loader.py in find_template, line 138
>
> Template-loader postmortem
> Django tried loading these templates, in this order:
>     * Using loader django.template.loaders.filesystem.Loader:
>     * Using loader django.template.loaders.app_directories.Loader:
>
> Any suggestions would be appreciated. Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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