Comment voir les requêtes SQL brutes exécutées par Django?
from django.db import connection
print(connection.queries)
Comment voir les requêtes SQL brutes exécutées par Django?
from django.db import connection
print(connection.queries)
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>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us