Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django 1.5 index page

Tags:

django

I have update my django to 1.5 and I have one problem: in urls.py I have

urlpatterns += patterns('django.views.generic.simple',
    (r'^$','direct_to_template', {'template': 'index.html'}),)

In 1.4 it works nice, but today it wrotes

"Could not import django.views.generic.simple.direct_to_template. Parent module django.views.generic.simple does not exist."

I searched in google - I find this, but it the same I have in code. Please, help

like image 656
Lev Avatar asked Feb 27 '13 16:02

Lev


1 Answers

That direct_to_template() function doesn't exist anymore.

Try this with a generic template view:

from django.conf.urls import patterns
from django.views.generic import TemplateView

urlpatterns = patterns('',
    (r'^$', TemplateView.as_view(template_name="index.html")),
)
like image 149
Adrián Avatar answered Oct 22 '22 19:10

Adrián