Django urls straight to html template

后端 未结 5 1943
我在风中等你
我在风中等你 2021-02-01 01:58

Learning django & python.

Just set up a new site after doing the tutorial. Now for arguments sake say I want to add a bunch of About us, FAQ basic html pages with ve

5条回答
  •  再見小時候
    2021-02-01 02:47

    Currently the best way to do this is using TemplateView from generic class-based views:

    from django.views.generic.base import TemplateView
    
    url(r'^$', TemplateView.as_view(template_name='index.html'), name='home'),
    

提交回复
热议问题