Commit a0ca53a6 authored by hypsug0's avatar hypsug0
Browse files

feat: Caching autocomplet user API

parent 63331e81
from django.urls import path from django.urls import path
from django.views.decorators.cache import cache_page
from .api import ProfileAutocompleteSearch from .api import ProfileAutocompleteSearch
from .views import ( from .views import (
...@@ -30,7 +31,11 @@ urlpatterns = [ ...@@ -30,7 +31,11 @@ urlpatterns = [
MyProfileDetailExport.as_view(), MyProfileDetailExport.as_view(),
name="myprofile_detail_export", name="myprofile_detail_export",
), ),
path("api/v1/profile/search", ProfileAutocompleteSearch.as_view(), name="profile_search_api"), path(
cache_page(60 * 15)(ProfileAutocompleteSearch.as_view()),
path("myprofile/update", MyProfileUpdate.as_view(), name="myprofile_update"), path("myprofile/update", MyProfileUpdate.as_view(), name="myprofile_update"),
path("list", UserListView.as_view(), name="user_search"), path("list", UserListView.as_view(), name="user_search"),
] ]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment