On Nov 7, 4:51 pm, "M. Herold" <digitallim...@gmail.com> wrote:
> That last, simple implementation is probably what I'm really looking
> for at this point. My only problem is I'm not sure where that line of
> code should live or where that template is expected (the template
> directory set in my settings.py, I imagine). I tried implementing it
> in urls.py, but it has some sort of syntax error:
>
> urlpatterns = patterns('',
>     (r'^polls/', include('polls.urls')),
>     (r'^admin/', include(admin.site.urls)),
>     (r'^$', TemplateView.as_view(template_name = '404.html'),
> )
>

If you're on Django prior to 1.3, you probably want the simple
direct_to_template generic view (which does still work in 1.3):
https://docs.djangoproject.com/en/dev/ref/generic-views/?from=olddocs#django-views-generic-simple-direct-to-template

If you ARE on 1.3, make sure you're importing TemplateView before you
try to use it.
from django.views.generic import TemplateView

Also, if you are going to do it all with template tags, watch your
queries. I think it's easier for them to spiral out of control with
template tags.

-- 
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