contact@digitalnotebooks.co
Stay Organized, Stay Inspired. Let's Write.

16. DRF Searching

Back To All Notes
  • Notebook: API Development using Django Framework
  • Speaker: Personal
  • Date Created: April 5, 2025, 7:07 p.m.
  • Owner: Rosilie

 

We can search through the database fields like BLOGS' title or comments.

1. Go to API\VIEWS.PY:

2.  Now search thru BLOGS model:

3. If you want to change the search keyword 'search' to 'q,' then update the SETTINGS.PY

FROM:

TO:

4. To search through the BLOG_BODY: 

5. To search for a blog title that starts with a specific keyword, use the caret symbol ( ^ ).

But when you use a keyword, not the actual starting word, it won't show any result.

 

 



No PDF file attached.

Notebook
Notebook Details
Title: API Development using Django Framework
Category: API