Can someone point me in the right direction here?

How does one use class-based generic views and named URLs?

Example (doesn't work):

> urls.py
> urlpatterns += patterns('myapp.views',
>    (r'^location/$', MyGenericView.as_view()),
> )

> views.py
> class MyGenericView(TemplateView):
>    template_name = 'example.html'

Now, I can make that work if I did this instead in
> urls.py
> from myapp.views import *
> urlpatterns += patterns('',
>     (r'^location/$', MyGenericView.as_view()),
> )

That approach just feels weird, am I doing it wrong or is that the new
normal?

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