Django follows a Model-View -Template (MVT) architecture which is a variant of the MVC architecture.
- Model: Logical data structure behind the entire app and signified by a database. A model is used in Django to represent a table in a database
- View: It's a user interface. What you see when you visit a website is called a user interface.
Tips and Tricks
Python | In-place swapping of two numbers
>>> a, b = 10, 20 >>> print(a, b) 10 20 >>> a, b = b, a >>> print(a, b) 20 10
Python | Reversing a String
>>> x = 'PythonWorld' >>> print(x[: : -1]) dlroWnohtyP
Python | Join all items of a list to convert into a single string
>>> x = ["Python", "Online", "Training"] >>> print(" ".join(x)) Python Online Training
Python | Return multiple values from functions
>>> def A(): return 2, 3, 4 >>> a, b, c = A() >>> print(a, b, c) 2 3 4
Python | Print String N times
>>> s = 'Python' >>> n = 5 >>> print(s * n) PythonPythonPythonPythonPython