In today’s session, we dive into Django Models, a core part of the MVT (Model–View–Template) architecture.
You will learn how Django interacts with the database using ORM (Object Relational Mapper) and how to create database tables without writing SQL.
This session focuses on creating a Student table, running migrations, and inserting records using the Django shell.
🚀 Topics Covered in This Video:
✔️ Understanding Django MVT Architecture (Model, View, Template)
✔️ What is a Model in Django?
✔️ Introduction to ORM (Object Relational Mapper)
✔️ Creating a Student table using models.Model
✔️ Using field types: CharField, IntegerField, EmailField
✔️ Writing models in models.py
✔️ Running makemigrations & migrate
✔️ Working with Django shell
✔️ Inserting data into database using ORM
✔️ Handling IntegerField validation errors
✔️ Background image setup using static files
🔴 Problem Statement
• Beginners don’t understand how Django connects to databases
• Writing raw SQL queries is complex and error-prone
• Confusion between Model and database tables
• Errors while inserting incorrect data types
• No clarity on how ORM works internally
✅ How This Session Solves the Problem
• Explains Models using real examples
• Shows how ORM replaces SQL queries
• Demonstrates migrations step by step
• Explains field validation errors clearly
• Helps beginners confidently work with databases
📁 Files Explained:
🟦 models.py
• Creating Student model
• Field types and constraints
🟦 views.py
• Understanding how views interact with models
🟦 urls.py
• URL mapping overview
🟦 Django Shell
• Creating objects
• Saving records
• Handling errors
🌟 About BasicToTop
BasicToTop is here to help you move forward — from basic to top.
We provide practical Python, Django, and backend training with real-world examples.
🔔 Subscribe for more Django & Python tutorials
👍 Like the video if it helped
💬 Ask your doubts in comments — I reply to everyone
🌐 Website: https://basictotop.in
Github repo : https://github.com/BasicToTop/Django-...
#django #python #webdevelopment #beginnerdjango #basictotop #BasicToToop
#djangomodels #makemigrations, #migrate