[django]cbv方式

cbv的方式

1.简单的url

from django.views.generic import TemplateView

path('', TemplateView.as_view(template_name='app01/index.html')),

2,写到类里

继承了View,

posted @ 2018-08-24 21:19  mmaotai  阅读(121)  评论(0编辑  收藏  举报