fix annotate query

This commit is contained in:
Tuan-Dung Bui 2023-04-17 02:44:48 +07:00
parent c3b7d465b1
commit dfc614ac1e
7 changed files with 70 additions and 51 deletions

View file

@ -219,6 +219,7 @@ else:
}
INSTALLED_APPS += (
"debug_toolbar",
"django.contrib.admin",
"judge",
"django.contrib.auth",
@ -248,6 +249,7 @@ INSTALLED_APPS += (
)
MIDDLEWARE = (
"debug_toolbar.middleware.DebugToolbarMiddleware",
"judge.middleware.SlowRequestMiddleware",
"judge.middleware.ShortCircuitMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
@ -424,11 +426,7 @@ STATIC_URL = "/static/"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
"LOCATION": [
"172.19.26.240:11211",
"172.19.26.242:11212",
"172.19.26.244:11213",
],
"LOCATION": "127.0.0.1:11211",
}
}
@ -490,3 +488,9 @@ except IOError:
pass
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
INTERNAL_IPS = [
# ...
"127.0.0.1",
# ...
]

View file

@ -207,6 +207,7 @@ def paged_list_view(view, name, **kwargs):
urlpatterns = [
path('__debug__/', include('debug_toolbar.urls')),
url("", include("pagedown.urls")),
url(
r"^$",
@ -469,8 +470,8 @@ urlpatterns = [
url(r"^comments/upvote/$", comment.upvote_comment, name="comment_upvote"),
url(r"^comments/downvote/$", comment.downvote_comment, name="comment_downvote"),
url(r"^comments/hide/$", comment.comment_hide, name="comment_hide"),
url(r"^comments/reply/$", comment.get_reply, name="comment_reply"),
url(r"^comments/showmore/$", comment.get_showmore, name="comment_show_more"),
url(r"^comments/get_replies/$", comment.get_replies, name="comment_get_replies"),
url(r"^comments/show_more/$", comment.get_show_more, name="comment_show_more"),
url(
r"^comments/(?P<id>\d+)/",
include(