What does django controllers are in views.py -


i have followed several django tutorials. not know why controllers stored in file called views.py. confuse filename. looking mvc development. there other files in django "real" controllers ?

yes ! it's design decision , it's described guys behind django here.

basically argument that, in opinion,

in our interpretation of mvc, “view” describes data gets presented user. it’s not how data looks, data presented. view describes data see, not how see it. it’s subtle distinction.

a “view” python callback function particular url, because callback function describes data presented.

i entice read entry hold of overal idea behind views naming.

about controllers, yes again. though, can define several layers of called middlewares in django handle lots of static logic before/after requests handled views, still, it's view plays main role of controller in django.

middlewares , views


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -