from django.urls import path
from django.views.generic.detail import DetailView

from .views import *
from .models import Photo


app_name = 'photo'
# 함수형 뷰는 함수 이름만 써주고, 클래스형 뷰는 뒤에 as_view() 를 써준다.
urlpatterns = [
    path('', photo_list, name='photo_list'),
    path('detail/<int:pk>/', DetailView.as_view(model=Photo, template_name ='photo/detail.html'), name = 'photo_detail'),
    path('upload/', PhotoUploadView.as_view(), name='photo_upload'),
    path('delete/<int:pk>/', PhotoUpdateView.as_view(),name = 'photo_delete'),
    path('update/<int:pk>/', PhotoUpdateView.as_view(), name='photo_update'),
]