Answers for "Comment voir les requêtes SQL brutes exécutées par Django?"

SQL
0

Comment voir les requêtes SQL brutes exécutées par Django?

from django.db import connection
print(connection.queries)
Posted by: Guest on September-06-2020
0

Comment voir les requêtes SQL brutes exécutées par Django?

./manage.py shell_plus --print-sql
User.objects.get(pk=1)
SELECT "auth_user"."id",
       "auth_user"."password",
       "auth_user"."last_login",
       "auth_user"."is_superuser",
       "auth_user"."username",
       "auth_user"."first_name",
       "auth_user"."last_name",
       "auth_user"."email",
       "auth_user"."is_staff",
       "auth_user"."is_active",
       "auth_user"."date_joined"
FROM "auth_user"
WHERE "auth_user"."id" = 1

Execution time: 0.002466s [Database: default]

<User: username>
Posted by: Guest on January-06-2021

Code answers related to "Comment voir les requêtes SQL brutes exécutées par Django?"

Code answers related to "SQL"

Browse Popular Code Answers by Language