Django Model Template and Views (Django MTV)

Django is often referred to as an MTV framework (Django MTV ) , where MTV works parallelly to develop a full stack web application. You can see the basic idea of MTV in diagram below:

Django MTV
Django MTV

Model:  M stands for Model. Model is an data access layer , where the application’s data stored . Basically django comes equipped with SQLlite whi ch is light weighted database, and is sufficient to stores application’s data. But if in case , other database required, then django can connect to a variety of SQL engine backends. In project’as file you can edit the ENGINE parameter used for Databases.

Django models created in app’s file and then connected to the original database with file, we will briefly discuss about eeverything about models in further articles, But for now you can say that Model is an core part of MTV which which knows everything about data ,  how to access it, how to validate it, which behaviors it has, and the relationships between the data and all.

Template:  T stands for template. It is an presentational layer which actually provide interface to the user. It contains everything about how data will show to user. It contains all the key parts of an web-page like colors, animations etc. As django provides an structured web-development process , templates stored in template folder which contain  html files,  Template further connected with Static files which are stored in Static folder . static folder may contain html, css, bootstrap, font, image files. All the connectivities to the static , template to the views are provide by the file. We will practically discuss all about that in further sections but for now you can say  Template actually decides , what and how should something  displayed on a web page.

View: V stands for view. Views is an business logic layer. It contain actual logic to access the models and delivered to the template. As  django is written in python, logics are also in the python (functions, classes, loops etc). These logics occurs in app’s file. In simple words we can say that View is an interface between template  and models, which delivers data from models to template.

It is sufficient to understand MTV . For developing a full stack website, one should know all about how to connect Model Template and Views. In summary we can say Model contains database, Template contains html, css files and view contain python files.

118 thoughts on “Django Model Template and Views (Django MTV)

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Good website! I really love how it is simple on my eyes and the data are well written. I’m wondering how I could be notified when a new post has been made. I’ve subscribed to your RSS feed which must do the trick! Have a nice day!

  2. I simply want to say I am just all new to blogging and actually loved your website. Most likely I’m planning to bookmark your site . You actually have incredible articles. Cheers for sharing with us your website page.

  3. Technological innovation has always been now there in making destin breast implants lives connected with men and women easier. In truth, thanks to technological know-how the planet involving thoughts has also been recently vanquished. Don’t make an effort to assume filthy right here people. Exactly what I’m speaking about is the like link that can take place via online dating sites along with chatting suites or even program for example ICQ, MSN or maybe MIRC.

  4. Hiya, I am really glad I’ve found this information. Nowadays bloggers publish only about gossips and net and this is actually irritating. A good blog with interesting content, this is what I need. Thanks for keeping this website, I’ll be visiting it. Do you do newsletters? Cant find it.

  5. I’d have to verify with you here. Which is not something I usually do! I take pleasure in studying a submit that will make individuals think. Also, thanks for permitting me to comment!

  6. Great post. I was checking constantly this blog and I’m impressed! Extremely helpful info specifically the last part 🙂 I care for such information a lot. I was seeking this particular information for a very long time. Thank you and best of luck.

  7. Terrific paintings! That is the kind of information that are meant to be shared around the net. Disgrace on the seek engines for not positioning this put up higher! Come on over and discuss with my site . Thanks =)

  8. Pretty section of content. I just stumbled upon your weblog and in accession capital to assert that I acquire in fact enjoyed account your blog posts. Anyway I will be subscribing to your feeds and even I achievement you access consistently rapidly.

  9. My brother suggested I might like this web site. He was totally right. This post truly made my day. You cann’t imagine simply how much time I had spent for this information! Thanks!

  10. Hello there, I discovered your blog by the use of Google at the same time as looking for a similar topic, your website came up, it looks great. I have bookmarked it in my google bookmarks.

  11. Hmm it appears like your website ate my first comment (it was super long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well am an aspiring blog blogger but I’m still new to everything. Do you have any tips for rookie blog writers? I’d definitely appreciate it.

  12. Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something. I think that you could do with some pics to drive the message home a bit, but other than that, this is great blog. An excellent read. I’ll definitely be back.

  13. You could definitely see your expertise within the work you write. The arena hopes for even more passionate writers like you who aren’t afraid to say how they believe. All the time follow your heart. “If the grass is greener in the other fellow’s yard – let him worry about cutting it.” by Fred Allen.

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.