Weird caching issue with database query

13 views
Skip to first unread message

Michael Jensen

unread,
Sep 4, 2020, 3:07:26 PM9/4/20
to Django users
I have a page that shows a grid of items and dates associated with that. I am using a JOIN query to get the data, but it appears to be cached or delayed somehow. When I query the database directly I can see the data has been updated, but on my page when I refresh it still doesn't show data there. Any ideas what it could be?

This is the structure of my views.py for that page:

    cursor = connection.cursor()
    sql =   '''*** complicated sql join query here with a search term...***'''

    try:
        cursor.execute(sql.format(search_term))
        the_items = dictfetchall(cursor)


I'm using Postgres and Django.

I tried python manage.py clear_cache but that didn't make any difference.

Thoughts? Thanks in advance!

Michael Jensen

unread,
Sep 4, 2020, 5:02:17 PM9/4/20
to Django users
Looks like it was my sql query, figured it out!
Reply all
Reply to author
Forward
0 new messages