From 918ee1461f36b31d484c11042d84130326cbd57a Mon Sep 17 00:00:00 2001 From: Daniel Diaz Date: Mon, 24 May 2021 23:29:17 -0500 Subject: [PATCH] Modified views and urls --- config/photoapp/urls.py | 2 +- config/photoapp/views.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/photoapp/urls.py b/config/photoapp/urls.py index 1c5900b..a415c52 100644 --- a/config/photoapp/urls.py +++ b/config/photoapp/urls.py @@ -11,7 +11,7 @@ PhotoDeleteView ) -appname = 'photo' +app_name = 'photo' urlpatterns = [ path('', PhotoListView.as_view(), name='list'), diff --git a/config/photoapp/views.py b/config/photoapp/views.py index 67daab1..42ef168 100644 --- a/config/photoapp/views.py +++ b/config/photoapp/views.py @@ -57,6 +57,8 @@ class PhotoDetailView(DetailView): class PhotoCreateView(LoginRequiredMixin, CreateView): + + template_name = 'photoapp/create.html' model = Photo @@ -86,6 +88,8 @@ def test_func(self): raise HttpResponseNotAllowed('Sorry you are not allowed here') class PhotoUpdateView(UserIsSubmitter, UpdateView): + + template_name = 'photoapp/update.html' model = Photo @@ -95,6 +99,8 @@ class PhotoUpdateView(UserIsSubmitter, UpdateView): class PhotoDeleteView(UserIsSubmitter, DeleteView): + template_name = 'photoapp/delete.html' + model = Photo success_url = reverse_lazy('photo:list') \ No newline at end of file