In this video, we are going to learn about the Django models. How can we create models in Django?How to migrate the models in Django?
What is models in Django?
A Django model is a tables, their fields, and various constraints in our database.
Migration and Migrate Commands in Django
To apply the changes of models (adding a field, deleting a model, etc.) into the database
Migrations are basically a version control system for our database schema.
Makemigrations: is responsible for packaging up your model changes into individual migration files. We can also say to commit the changes.
Migrate: is responsible for applying those to your database. Like to push the changes to the database tables.
Migration Commands:
python manage.py makemigrations
python manage.py migrate
👍 If you enjoyed this content, give the video a like. If you want to watch more upcoming videos, consider subscribing to the channel! → / @skillshats
DJANGO PLAYLIST:
• Django
🎬 RECOMMENDED VIDEOS:
Django Models:
→ • Add record in Django model | Python
→ • Add record in Django model | Python
→ • Update & Delete record in Django Mode...
䷐ FOLLOW US:
Website: https://skillshats.com
Twitter: / skillshats
🏷 TAGS:
#python #django #django-models
Thanks!!
Enjoy 🤗