How can I satisfy an import of direct_to_template?

后端 未结 2 1369
北恋
北恋 2021-01-03 21:53

I am getting an error page from an originally Pinax 0.7 project:

ImportError at /
No module named simple
Request Method: GET
Request URL:    http://stornge.c         


        
2条回答
  •  孤街浪徒
    2021-01-03 22:50

    direct_to_template has been deprecated. In django 1.5 try using a Class based view in urls.py

    from django.views.generic import TemplateView
    
    urlpatterns = patterns('',
        url(r'^$', TemplateView.as_view(template_name='homepage.html'), name="home"),
    )
    

    There's some information on migrating to version 1.4 (when it was deprecated) here.

提交回复
热议问题