Class views in Django

前端 未结 9 1829
一生所求
一生所求 2020-12-05 06:15

Django view points to a function, which can be a problem if you want to change only a bit of functionality. Yes, I could have million keyword arguments and even more if stat

9条回答
  •  清歌不尽
    2020-12-05 06:46

    If you want to share common functionality between pages I suggest you look at custom tags. They're quite easy to create, and are very powerful.

    Also, templates can extend from other templates. This allows you to have a base template to set up the layout of the page and to share this between other templates which fill in the blanks. You can nest templates to any depth; allowing you to specify the layout on separate groups of related pages in one place.

提交回复
热议问题