Python-Django workshop

ThinkFOSS web team

Day 1, Live at SCET, Thrissur

admin@thinkfoss.com

 

Introduction to MVC Concepts

Models

  • the Database table 
  • represented as a class 
  • table rows are objects 

Views

  • the business logic
  • what to do with the model 
  • where to display the results

Controller

  • the routing logic
  • request reach here firstly

browser request

urls.py

views.py

models.py

views.py

browser response

https://www.thinkfoss.com/register/user/portal/student/

urls.py

views.py

then...

takes in the data from the Course model, 

 

and show up in the page! 

What is the advantage ?

  1. 0 queries, so 0 worries 
  2. code and templates neat and separate 
  3. change of, say url, do not affect anything else 

more advantages, coming up ..

MVC intro, Django

By Tony Thomas

MVC intro, Django

  • 880