亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

About class-based views in django and flask?
歐陽(yáng)克
歐陽(yáng)克 2017-06-22 11:51:58
0
2
837

I was reading the Flask documentation recently and found that in Django and Flask, views are both based on functions and classes (called plug-in views in Flask). I don’t quite understand the difference between these two views. Since I have just started, I have always used functional views. What is the difference between these two views? In formal development, are functional views or class-based views used more?

歐陽(yáng)克
歐陽(yáng)克

溫故而知新,可以為師矣。 博客:www.ouyangke.com

reply all(2)
曾經(jīng)蠟筆沒(méi)有小新

There is no difference, it’s just a different style when writing code.

Class-based views emphasize defining all views in one place,
Function-based views are defined where they are used.

阿神

Class-based views facilitate logic reuse. You can write common logic in multiple views in a base class, and the view class that inherits this base class can have this logic.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template