How can I satisfy an import of direct_to_template?

后端 未结 2 1384
北恋
北恋 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:42

    Besides the class-based view TemplateView, you can also use the render function like this:

    from django.shortcuts import render
    
    urlpatterns = patterns("",
        url(r'^$', lambda request: render(request, 'homepage.html'), name="home"),
    )
    

提交回复
热议问题