Initial commit: Django gallery project

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 16:47:17 +08:00
commit 8b57a7b66a
53 changed files with 3633 additions and 0 deletions

27
gallery/urls.py Normal file
View File

@@ -0,0 +1,27 @@
from django.urls import path
from . import views
urlpatterns = [
# 首页
path('', views.index, name='index'),
# 作品详情页
path('gallery/<slug:slug>/', views.ArtworkDetailView.as_view(), name='artwork_detail'),
# 关于页面
path('about/', views.about, name='about'),
# 搜索页面
path('search/', views.search, name='search'),
# 分类页面
path('category/<slug:slug>/', views.category_view, name='category'),
# 用户认证
path('login/', views.login_view, name='login'),
path('logout/', views.logout_view, name='logout'),
# 评论功能
path('artwork/<slug:artwork_slug>/comment/add/', views.add_comment, name='add_comment'),
path('comment/<int:pk>/delete/', views.delete_comment, name='delete_comment'),
]