HOW TO CREATE MODEL IN DJANGO AND THEN USE DJANGO ORM UPDATE QUERY

YouTube Link : https://www.youtube.com/watch?v=OjQLjb09cXc&t=389s

1. Create Virtual Environment

a. virtualenv <virtualenvironment name>

b. cd <virtualenvironment name>

c. source bin/activate

d. pip install django

2. Create Django Project And App

a. django-admin startproject <projectname>

b. cd <projectname>

c. python manage.py migrate

d. python manage.py createsuperuser

e. python manage.py startapp <appname>(for ex in my case my app name is “testapp”)

3. Create Model In Django Project And Register In Admin File

Models.py

4. Admin File

Admin.py

5. Go To Admin And Create Student With Name ,Age ,Rollno

6. Go To Python Shell

Update all student age to 12
Update student whose roll no =12 updated their name to deepak