comment create and get view

This commit is contained in:
Parsa Nazer
2024-12-12 18:07:17 +03:30
parent f1659f4289
commit 30f5ca97f1
9 changed files with 207 additions and 5 deletions
+51
View File
@@ -93,6 +93,8 @@ INSTALLED_APPS = [
'rest_framework_simplejwt.token_blacklist',
'rest_framework.authtoken',
'djoser',
# custom apps
'product'
]
MIDDLEWARE = [
@@ -248,6 +250,55 @@ UNFOLD = {
},
},
},
"SIDEBAR": {
"show_search": True,
"show_all_applications": False,
"navigation": [
{
"separator": False, # Top border
"collapsible": False, # Collapsible group of links
"items": [
{
"title": _("داشبرد ادمین"),
"icon": "dashboard",
"link": reverse_lazy("admin:index"),
},
],
},
{
"title": _("پنل فروش محصولات وبسایت"),
"separator": True,
"collapsible": True,
"items": [
{
"title": _("محصولات"),
"icon": "redeem",
"link": reverse_lazy("admin:product_product_changelist"),
},
# esm category model ro lower case bezar inja amir
# {
# "title": _("دسته بندی"),
# "icon": "category",
# "link": reverse_lazy("admin:product_ _changelist"),
# },
{
"title": _("نظرات"),
"icon": "chat",
"link": reverse_lazy("admin:product_commentmodel_changelist"),
},
],
},
],
},
}
+2 -1
View File
@@ -4,7 +4,7 @@ from django.urls import path, include
from drf_spectacular.views import SpectacularSwaggerView, SpectacularAPIView
from django.conf import settings
from rest_framework_simplejwt.views import TokenObtainPairView,TokenRefreshView
from product import views
urlpatterns = [
# djoser
@@ -16,6 +16,7 @@ urlpatterns = [
path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
path('admin/', admin.site.urls),
path('schema/', SpectacularAPIView.as_view(), name='schema'),
path('comment/<int:product_pk>', views.CommentView.as_view(), name='comment-list'),
path('', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),
]