Computer Science/BackEnd

Django | SQL 쿼리 로그로 Django QuerySet 이해하기

토마토. 2022. 10. 29. 23:13

이어지는 글

Django | Django ORM QuerySet 사용하기 — HappyTomatoLife (tistory.com)


 

step 1. QuerySet 함수의 SQL문 이해하기

.filter

>>> from post.models import Post, Comment, Tag, Clapse
>>> queryset = Comment.objects.filter(post=1)
>>> str(queryset.query)
'SELECT "post_comment"."id", "post_comment"."post_id", "post_comment"."created_by_id", "post_comment"."created_at", "post_comment"."updated_at", "post_comment"."is_updated", "post_comment"."content", "post_comment"."parent_comment_id", "post_comment"."create_tag" 
FROM "post_comment" 
WHERE "post_comment"."post_id" = 1'

 

.create

따로 없음

 

.save

따로 없음

 

.all

>>> from post.models import Post
>>> queryset = Post.objects.all()
>>> str(queryset.query)
'SELECT "post_post"."id", "post_post"."created_by_id", "post_post"."created_at", "post_post"."updated_at", "post_post"."title", "post_post"."description", "post_post"."summary_for_listing", "post_post"."n_min_read", "post_post"."create_tag" 
FROM "post_post" 
ORDER BY "post_post"."created_at" DESC'

 

.get

따로 없음

 

.delete

따로 없음

 

.add

따로 없음

 

.remove

따로 없음

 


콘솔창에서 SQL 쿼리 로그 확인하기

settings.py에 다음 코드를 추가해준다. 

LOGGING = {
    "version": 1,
    "disable_existing_loggers": False,
    "handlers": {
        "console": {
            "level": "DEBUG",
            "class": "logging.StreamHandler",
        },
    },
    "loggers": {
        "django.db.backends": {
            "handlers": ["console"],
            "level": "DEBUG",
        },
    },
}

[참고] [Django] SQL 쿼리 로그 확인하기 (feat. 콘솔창) (tistory.com)

 

  • POST /v1/user/register/

(0.005) SELECT 1 AS "a" FROM "user_user" WHERE "user_user"."username" = 'newusername' LIMIT 1; args=(1, 'newusername'); alias=default
(0.023) INSERT INTO "user_user" ("password", "last_login", "is_superuser", "username", "first_name", "last_name", "email", "is_staff", "is_active", "date_joined", "nickname", "short_bio", "photo", "url") VALUES ('pbkdf2_sha256$390000$RYtjcP5Lgl1OHzPzauOX5C$lYoyLhg6MtyD2GoNk7R8lxhhrVl6WEeBIDUy9zBX6I4=', NULL, 0, 'newusername', '', '', '', 0, 1, '2022-11-01 08:12:55.645187', NULL, NULL, '', NULL); args=['pbkdf2_sha256$390000$RYtjcP5Lgl1OHzPzauOX5C$lYoyLhg6MtyD2GoNk7R8lxhhrVl6WEeBIDUy9zBX6I4=', None, False, 'newusername', '', '', '', False, True, '2022-11-01 08:12:55.645187', None, None, '', None]; alias=default
(0.017) INSERT INTO "authtoken_token" ("key", "user_id", "created") VALUES ('f3953193826aa704bd41a7bf72f19397ac56f82d', 8, '2022-11-01 08:12:56.038856'); args=('f3953193826aa704bd41a7bf72f19397ac56f82d', 8, '2022-11-01 
08:12:56.038856'); alias=default
(0.002) SELECT "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "user_user" INNER JOIN "user_user_followers" ON ("user_user"."id" = "user_user_followers"."to_user_id") WHERE "user_user_followers"."from_user_id" = 8; args=(8,); alias=default
(0.002) SELECT "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "user_user" INNER JOIN "user_user_following" ON ("user_user"."id" = "user_user_following"."to_user_id") WHERE "user_user_following"."from_user_id" = 8; args=(8,); alias=default

 

  • POST /v1/user/login/

(0.006) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "authtoken_token" INNER JOIN "user_user" ON ("authtoken_token"."user_id" = "user_user"."id") WHERE "authtoken_token"."key" = 
'1d8994b012b3b0a510f14dcef7b7e7ed3c117a12' LIMIT 21; args=('1d8994b012b3b0a510f14dcef7b7e7ed3c117a12',); alias=default
(0.002) SELECT "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "user_user" WHERE "user_user"."username" = 'newusername' LIMIT 21; args=('newusername',); alias=default
(0.002) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created" FROM "authtoken_token" WHERE "authtoken_token"."user_id" = 8 LIMIT 21; args=(8,); alias=default
[01/Nov/2022 08:14:15] "POST /v1/user/login/ HTTP/1.1" 200 52
(0.005) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "authtoken_token" INNER JOIN "user_user" ON ("authtoken_token"."user_id" = "user_user"."id") WHERE "authtoken_token"."key" = 
'1d8994b012b3b0a510f14dcef7b7e7ed3c117a12' LIMIT 21; args=('1d8994b012b3b0a510f14dcef7b7e7ed3c117a12',); alias=default
(0.004) SELECT "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "user_user" WHERE "user_user"."username" = 'newusername' LIMIT 21; args=('newusername',); alias=default
(0.002) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created" FROM "authtoken_token" WHERE "authtoken_token"."user_id" = 8 LIMIT 21; args=(8,); alias=default

 

  • POST /v1/user/follow/<int:pk>/

(0.004) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "authtoken_token" INNER JOIN "user_user" ON ("authtoken_token"."user_id" = "user_user"."id") WHERE "authtoken_token"."key" = 
'1d8994b012b3b0a510f14dcef7b7e7ed3c117a12' LIMIT 21; args=('1d8994b012b3b0a510f14dcef7b7e7ed3c117a12',); alias=default
(0.001) SELECT "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "user_user" WHERE "user_user"."id" = 1 LIMIT 21; args=(1,); alias=default
(0.002) SELECT "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "user_user" INNER JOIN "user_user_following" ON ("user_user"."id" = "user_user_following"."to_user_id") WHERE "user_user_following"."from_user_id" = 1; args=(1,); alias=default
(0.000) BEGIN; args=None; alias=default
(0.012) INSERT OR IGNORE INTO "user_user_following" ("from_user_id", "to_user_id") VALUES (1, 1); args=(1, 1); alias=default
(0.000) INSERT OR IGNORE INTO "user_user_following" ("from_user_id", "to_user_id") VALUES (1, 1); args=(1, 1); alias=default
(0.000) BEGIN; args=None; alias=default
(0.010) INSERT OR IGNORE INTO "user_user_followers" ("from_user_id", "to_user_id") VALUES (1, 1); args=(1, 1); alias=default
(0.000) INSERT OR IGNORE INTO "user_user_followers" ("from_user_id", "to_user_id") VALUES (1, 1); args=(1, 1); alias=default
(0.022) INSERT INTO "notification_notification" ("created_at", "notify_from_id", "notify_to_id", "notification_type", "post_id", "comment") VALUES ('2022-11-01 08:17:32.266574', 1, 1, 'follow', NULL, NULL); args=['2022-11-01 08:17:32.266574', 1, 1, 'follow', None, None]; alias=default       
(0.016) UPDATE "notification_notification" SET "created_at" = '2022-11-01 08:17:32.266574', "notify_from_id" = 1, "notify_to_id" = 1, "notification_type" = 'follow', "post_id" = NULL, "comment" = NULL WHERE "notification_notification"."id" = 55; args=('2022-11-01 08:17:32.266574', 1, 1, 'follow', 55); alias=default

  • POST /v1/user/unfollow/<int:pk>/

(0.005) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "authtoken_token" INNER JOIN "user_user" ON ("authtoken_token"."user_id" = "user_user"."id") WHERE "authtoken_token"."key" = 
'1d8994b012b3b0a510f14dcef7b7e7ed3c117a12' LIMIT 21; args=('1d8994b012b3b0a510f14dcef7b7e7ed3c117a12',); alias=default
(0.001) SELECT "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "user_user" WHERE "user_user"."id" = 1 LIMIT 21; args=(1,); alias=default
(0.002) SELECT "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "user_user" INNER JOIN "user_user_following" ON ("user_user"."id" = "user_user_following"."to_user_id") WHERE "user_user_following"."from_user_id" = 1; args=(1,); alias=default
(0.000) BEGIN; args=None; alias=default
(0.016) DELETE FROM "user_user_following" WHERE (("user_user_following"."from_user_id" = 1 AND "user_user_following"."to_user_id" IN (1)) OR ("user_user_following"."to_user_id" = 1 AND "user_user_following"."from_user_id" IN (1))); args=(1, 1, 1, 1); alias=default
(0.000) BEGIN; args=None; alias=default
(0.008) DELETE FROM "user_user_followers" WHERE (("user_user_followers"."from_user_id" = 1 AND "user_user_followers"."to_user_id" IN (1)) OR ("user_user_followers"."to_user_id" = 1 AND "user_user_followers"."from_user_id" IN (1))); args=(1, 1, 1, 1); alias=default
(0.022) INSERT INTO "notification_notification" ("created_at", "notify_from_id", "notify_to_id", "notification_type", "post_id", "comment") VALUES ('2022-11-01 08:18:00.640180', 1, 1, 'unfollow', NULL, NULL); args=['2022-11-01 08:18:00.640180', 1, 1, 'unfollow', None, None]; alias=default   
(0.018) UPDATE "notification_notification" SET "created_at" = '2022-11-01 08:18:00.640180', "notify_from_id" = 1, "notify_to_id" = 1, "notification_type" = 'unfollow', "post_id" = NULL, "comment" = NULL WHERE "notification_notification"."id" = 56; args=('2022-11-01 08:18:00.640180', 1, 1, 'unfollow', 56); alias=default

  • GET /v1/user/profile/

(0.005) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "authtoken_token" INNER JOIN "user_user" ON ("authtoken_token"."user_id" = "user_user"."id") WHERE "authtoken_token"."key" = 
'1d8994b012b3b0a510f14dcef7b7e7ed3c117a12' LIMIT 21; args=('1d8994b012b3b0a510f14dcef7b7e7ed3c117a12',); alias=default
(0.001) SELECT "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "user_user" WHERE "user_user"."id" = 1 LIMIT 21; args=(1,); alias=default
(0.002) SELECT "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "user_user" INNER JOIN "user_user_followers" ON ("user_user"."id" = "user_user_followers"."to_user_id") WHERE "user_user_followers"."from_user_id" = 1; args=(1,); alias=default
(0.005) SELECT "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "user_user" INNER JOIN "user_user_following" ON ("user_user"."id" = "user_user_following"."to_user_id") WHERE "user_user_following"."from_user_id" = 1; args=(1,); alias=default

  • GET /v1/post/

(0.005) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "authtoken_token" INNER JOIN "user_user" ON ("authtoken_token"."user_id" = "user_user"."id") WHERE "authtoken_token"."key" = 
'1d8994b012b3b0a510f14dcef7b7e7ed3c117a12' LIMIT 21; args=('1d8994b012b3b0a510f14dcef7b7e7ed3c117a12',); alias=default
(0.009) SELECT "post_post"."id", "post_post"."created_by_id", "post_post"."created_at", "post_post"."updated_at", "post_post"."title", "post_post"."description", "post_post"."summary_for_listing", "post_post"."n_min_read", "post_post"."create_tag" FROM "post_post" ORDER BY "post_post"."created_at" DESC LIMIT 21; args=(); alias=default
<QuerySet [<Post: title>, <Post: title>, <Post: title>, <Post: title>, <Post: title>, <Post: title>, <Post: title>, <Post: title>, <Post: title>, 
<Post: title>, <Post: title>, <Post: title>, <Post: title>, <Post: title>, <Post: title>, <Post: title>, <Post: title>]>
(0.002) SELECT "post_post"."id", "post_post"."created_by_id", "post_post"."created_at", "post_post"."updated_at", "post_post"."title", "post_post"."description", "post_post"."summary_for_listing", "post_post"."n_min_read", "post_post"."create_tag" FROM "post_post" ORDER BY "post_post"."created_at" DESC; args=(); alias=default

  • POST /v1/post/

(0.007) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "authtoken_token" INNER JOIN "user_user" ON ("authtoken_token"."user_id" = "user_user"."id") WHERE "authtoken_token"."key" = 
'1d8994b012b3b0a510f14dcef7b7e7ed3c117a12' LIMIT 21; args=('1d8994b012b3b0a510f14dcef7b7e7ed3c117a12',); alias=default
(0.028) INSERT INTO "post_post" ("created_by_id", "created_at", "updated_at", "title", "description", "summary_for_listing", "n_min_read", "create_tag") VALUES (1, '2022-11-01 08:20:46.535067', '2022-11-01 08:20:46.535106', 'newusername', 'password', 'password', 1, '#tag'); args=[1, '2022-11-01 08:20:46.535067', '2022-11-01 08:20:46.535106', 'newusername', 'password', 'password', 1, '#tag']; alias=default
(0.028) SELECT "post_tag"."id", "post_tag"."name", "post_tag"."created_at" FROM "post_tag" WHERE "post_tag"."name" = 'tag' LIMIT 21; args=('tag',); alias=default
(0.000) BEGIN; args=None; alias=default
(0.038) INSERT OR IGNORE INTO "post_post_tags" ("post_id", "tag_id") VALUES (20, 7); args=(20, 7); alias=default
(0.029) UPDATE "post_post" SET "created_by_id" = 1, "created_at" = '2022-11-01 08:20:46.535067', "updated_at" = '2022-11-01 08:20:46.663778', "title" = 'newusername', "description" = 'password', "summary_for_listing" = 
'password', "n_min_read" = 1, "create_tag" = '#tag' WHERE "post_post"."id" = 20; args=(1, '2022-11-01 08:20:46.535067', '2022-11-01 08:20:46.663778', 'newusername', 'password', 'password', 1, '#tag', 20); alias=default 
(0.003) SELECT "post_tag"."id", "post_tag"."name", "post_tag"."created_at" FROM "post_tag" INNER JOIN "post_post_tags" ON ("post_tag"."id" = "post_post_tags"."tag_id") WHERE "post_post_tags"."post_id" = 20; args=(20,); 
alias=default

  • GET /v1/post/<int:pk>/

(0.006) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "authtoken_token" INNER JOIN "user_user" ON ("authtoken_token"."user_id" = "user_user"."id") WHERE "authtoken_token"."key" = 
'1d8994b012b3b0a510f14dcef7b7e7ed3c117a12' LIMIT 21; args=('1d8994b012b3b0a510f14dcef7b7e7ed3c117a12',); alias=default
(0.002) SELECT "post_post"."id", "post_post"."created_by_id", "post_post"."created_at", "post_post"."updated_at", "post_post"."title", "post_post"."description", "post_post"."summary_for_listing", "post_post"."n_min_read", "post_post"."create_tag" FROM "post_post" WHERE "post_post"."id" = 2 
LIMIT 21; args=(2,); alias=default
(0.002) SELECT "post_tag"."id", "post_tag"."name", "post_tag"."created_at" FROM "post_tag" INNER JOIN "post_post_tags" ON ("post_tag"."id" = "post_post_tags"."tag_id") WHERE "post_post_tags"."post_id" = 2; args=(2,); alias=default

  • PUT /v1/post/<int:pk>/

(0.005) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "authtoken_token" INNER JOIN "user_user" ON ("authtoken_token"."user_id" = "user_user"."id") WHERE "authtoken_token"."key" = 
'1d8994b012b3b0a510f14dcef7b7e7ed3c117a12' LIMIT 21; args=('1d8994b012b3b0a510f14dcef7b7e7ed3c117a12',); alias=default
(0.002) SELECT "post_post"."id", "post_post"."created_by_id", "post_post"."created_at", "post_post"."updated_at", "post_post"."title", "post_post"."description", "post_post"."summary_for_listing", "post_post"."n_min_read", "post_post"."create_tag" FROM "post_post" WHERE "post_post"."id" = 2 
LIMIT 21; args=(2,); alias=default
(0.023) UPDATE "post_post" SET "created_by_id" = 1, "created_at" = '2022-10-22 06:02:59.494912', "updated_at" = '2022-11-01 08:22:19.406632', "title" = 'newusername', "description" = 'password', "summary_for_listing" = 
'post content', "n_min_read" = 0, "create_tag" = '#tag' WHERE "post_post"."id" = 2; args=(1, '2022-10-22 06:02:59.494912', '2022-11-01 08:22:19.406632', 'newusername', 'password', 'post content', 0, '#tag', 2); alias=default
(0.002) SELECT "post_tag"."id", "post_tag"."name", "post_tag"."created_at" FROM "post_tag" INNER JOIN "post_post_tags" ON ("post_tag"."id" = "post_post_tags"."tag_id") WHERE "post_post_tags"."post_id" = 2; args=(2,); alias=default

  • DELETE /v1/post/<int:pk>/

(0.005) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "authtoken_token" INNER JOIN "user_user" ON ("authtoken_token"."user_id" = "user_user"."id") WHERE "authtoken_token"."key" = 
'1d8994b012b3b0a510f14dcef7b7e7ed3c117a12' LIMIT 21; args=('1d8994b012b3b0a510f14dcef7b7e7ed3c117a12',); alias=default
(0.002) SELECT "post_post"."id", "post_post"."created_by_id", "post_post"."created_at", "post_post"."updated_at", "post_post"."title", "post_post"."description", "post_post"."summary_for_listing", "post_post"."n_min_read", "post_post"."create_tag" FROM "post_post" WHERE "post_post"."id" = 2 
LIMIT 21; args=(2,); alias=default
(0.009) SELECT "post_comment"."id" FROM "post_comment" WHERE "post_comment"."post_id" IN (2); args=(2,); alias=default
(0.002) SELECT "post_comment"."id" FROM "post_comment" WHERE "post_comment"."parent_comment_id" IN (13, 14, 16); args=(13, 14, 16); alias=default 
(0.000) BEGIN; args=None; alias=default
(0.008) DELETE FROM "post_comment_tags" WHERE "post_comment_tags"."comment_id" IN (13, 14, 16); args=(13, 14, 16); alias=default
(0.003) DELETE FROM "post_post_tags" WHERE "post_post_tags"."post_id" IN 
(2); args=(2,); alias=default
(0.001) DELETE FROM "post_clapse" WHERE "post_clapse"."post_id" IN (2); args=(2,); alias=default
(0.003) DELETE FROM "notification_notification" WHERE "notification_notification"."post_id" IN (2); args=(2,); alias=default
(0.001) DELETE FROM "post_post" WHERE "post_post"."id" IN (2); args=(2,); alias=default
(0.003) DELETE FROM "post_comment" WHERE "post_comment"."id" IN (16, 14, 
13); args=(16, 14, 13); alias=default

  • GET /v1/post/<int:pk>/comment/

(0.005) SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "user_user"."id", "user_user"."password", "user_user"."last_login", "user_user"."is_superuser", "user_user"."username", "user_user"."first_name", "user_user"."last_name", "user_user"."email", "user_user"."is_staff", "user_user"."is_active", "user_user"."date_joined", "user_user"."nickname", "user_user"."short_bio", "user_user"."photo", "user_user"."url" FROM "authtoken_token" INNER JOIN "user_user" ON ("authtoken_token"."user_id" = "user_user"."id") WHERE "authtoken_token"."key" = 
'1d8994b012b3b0a510f14dcef7b7e7ed3c117a12' LIMIT 21; args=('1d8994b012b3b0a510f14dcef7b7e7ed3c117a12',); alias=default
(0.002) SELECT "post_comment"."id", "post_comment"."post_id", "post_comment"."created_by_id", "post_comment"."created_at", "post_comment"."updated_at", "post_comment"."is_updated", "post_comment"."content", "post_comment"."parent_comment_id", "post_comment"."create_tag" FROM "post_comment" WHERE "post_comment"."post_id" = 3; args=(3,); alias=default

  • POST /v1/post/<int:pk>/comment/

 

  • PUT /v1/post/<int:pk>/comment/<int:pk2>/

 

  • DELETE /v1/post/<int:pk>/comment/<int:pk2>/

 

  • GET /v1/post/<int:pk>/clapse/

 

  • POST /v1/post/<int:pk>/clapse/

 

  • DELETE /v1/post/<int:pk>/unclapse/

 

  • GET /v1/post/tag/<str:tagname>/post/

 

  • GET /v1/post/tag/<str:tagname>/comment/

 

  • GET /v1/notification/