Query data in Django

Offered By
Coursera Project Network
In this Guided Project, you will:

Query Django models using QuerySet methods and Q objects.

Learn how to construct complex queries

Learn how to query across relationships

Clock2 hours
CloudNo download needed
VideoSplit-screen video
Comment DotsEnglish
LaptopDesktop only

In this 1-hour long project-based course, you will learn how to use the QuerySet methods and the Q objects to query data in Django. You will generate a sample project and create a view that populates the database with sample data. You will then learn the syntax of keyword arguments to construct queries using the QuerySet methods. You will create complex queries using the Q objects, and finally you will learn how to query across relationships. Note: This course works best for learners who are based in the North America region. We’re currently working on providing the same experience in other regions.

Skills you will develop

Python ProgrammingDjango developmentDjango QuerySet APIObject-Oriented Programming (OOP)

Learn step-by-step

In a video that plays in a split-screen with your work area, your instructor will walk you through these steps:

  1. Create the bookstore Django project and its apps

  2. Create the setup view which will automate entry of sample data

  3. Run queries using the QuerySet method get()

  4. Run queries using the QuerySet method filter()

  5. Apply the membership and string lookup types

  6. Query using the QuerySet exclude method and nest filters

  7. Query using Q objects

  8. Query across relationships

How Guided Projects work

Your workspace is a cloud desktop right in your browser, no download required

In a split-screen video, your instructor guides you step-by-step

Frequently asked questions

Frequently Asked Questions

More questions? Visit the Learner Help Center.