4 Django ORM
This chapter covers
- Interacting with a database through the Django ORM
- Creating objects that map to database tables
- Querying the database
- Building object relationships
- Loading and storing content through fixtures
This chapter introduces you to Django’s object relational mapping (ORM), an object-oriented abstraction for interacting with databases. Django provides a way to create, read, update, and delete both data and tables in a database to add storage capabilities to your website.
4.1 Interacting with a database
Until now, RiffMates has been composed of mostly static content. You learned how to write views that are called when a user visits a URL, and inside those views, you created small dictionaries to provide context ...
Get Django in Action now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.