Code Fellows 401
Day 27 Notes
Home
Reading
Using Models
Django Admin
Advanced configuration section is optional
The tutorial is really good but some of the tools are dated so when reading try to understand the concepts more than the code.
(Optional): Beginner’s Guide to Django - Part 1
Bookmark and Review
Beginner’s Guide to Django - Part 2
Things I want to know more about
- The article is about using models in the Django web framework.
- Models in Django are Python classes that define fields and behaviors of the data that will be stored in the database.
- Each model represents a single table in the database, and each attribute of the model represents a column in that table.
- Django provides a built-in ORM (Object-Relational Mapper) that allows you to interact with the database using Python code instead of SQL.
- You can create a model by defining a Python class that inherits from the django.db.models.Model class.
- You can define fields for the model by adding attributes to the class and setting them to the appropriate field type.
- You can also define relationships between models, such as one-to-many and many-to-many, using fields such as ForeignKey and ManyToManyField.
- Once you have defined your models, you can use the Django ORM to create, read, update, and delete records in the database using Python code.