[Django]-Django ORM : how can i see last executed query on fly

5👍

Try:

from django.db import connection as conn
filterd = User.objects.exclude(id = request.user.id).filter(username=data['username'] )
# to execute query
print filterd
print conn.queries

Leave a comment