in Technology by

Django appears to be a MVC framework, but you call the Controller the “view”, and the View the “template”. How come you don’t use the standard names?

1 Answer

0 votes
by

Well, the standard names are debatable.

In our interpretation of MVC, the “view” describes the data that gets presented to the user. It’s not necessarily how the data looks, but which data is presented. The view describes which data you see, not how you see it. It’s a subtle distinction.

So, in our case, a “view” is the Python callback function for a particular URL, because that callback function describes which data is presented.

Furthermore, it’s sensible to separate content from presentation – which is where templates come in. In Django, a “view” describes which data is presented, but a view normally delegates to a template, which describes how the data is presented.

Where does the “controller” fit in, then? In Django’s case, it’s probably the framework itself: the machinery that sends a request to the appropriate view, according to the Django URL configuration.

If you’re hungry for acronyms, you might say that Django is a “MTV” framework – that is, “model”, “template”, and “view.” That breakdown makes much more sense.

At the end of the day, it comes down to getting stuff done. And, regardless of how things are named, Django gets stuff done in a way that’s most logical to us.

Related questions

0 votes
    Big multinational companies are providing us with search engines to easily search for data for free. But they are also taking ... habits as well as choices. 1) True 2) False...
asked Dec 29, 2020 in Technology by JackTerrance
0 votes
0 votes
    SQL structure such as table names, column names, and so on cannot be escaped, and thus user-supplied structure names are ... issue in a report-writing software. 1. True 2. False...
asked Mar 20, 2021 in Technology by JackTerrance
0 votes
    Where are SQL Server user names and passwords stored in SQL Server?...
asked Nov 9, 2020 in Technology by Editorial Staff
0 votes
    Which of the following statements is/are correct about the interpretation of a correlation that equals .30? a.It ... enough to assure clinical significance d.None of the above...
asked Nov 30, 2020 in Technology by Editorial Staff
0 votes
    What was the operation governance app you were demoing? It looks insanely good for our guest user and Teams management needs....
asked Mar 10, 2021 in Technology by JackTerrance
0 votes
    ______________ is a form of nasty online attack in which a user gets redirects queries to a DNS because of ... -for-Cyber Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    How to get callback in our app when user delete song from music app. Is there any solution? Thanks ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    The term for information that describes what type of data is available in a database is: (a) Data ... Answers, Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    Do these insights work on a file-level as well? For instance, would they work when a single file is shared by a user?...
asked Mar 10, 2021 in Technology by JackTerrance
0 votes
    Design a view in a map such that if a user selects any state, the profit and sales in the cities under that state would show up....
asked Oct 30, 2020 in Technology by JackTerrance
0 votes
    __________________is a computing action used in which usernames & info about user-groups, shares as well as services of ... questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
...