Django static page?

后端 未结 5 1504
迷失自我
迷失自我 2021-01-30 11:25

I want to make a static page which will be shown to the user only if he/she clicks on a link provided in one of my models. I can do this by making a Python page alone and callin

5条回答
  •  执笔经年
    2021-01-30 11:42

    With the class-based views in newer Django versions, one can use this in urls.py:

    from django.views.generic import TemplateView
    url(r'^about', 
        TemplateView.as_view(template_name='path/to/about_us.html'),
        name='about'),
    

提交回复
热议问题