Forums

Django customisation does not work

Hi. I've got a web app built on Django Photologue. I want to add some changes (limited access to web). I created a new application, photologue_custom. But I have error: "TemplateDoesNotExist at...No template names provided".

urls.py at photologue_custom

urlpatterns = [
url(r'^gallerylist/$',
CustomGalleryListView.as_view(),
name='gallery-list'),
    ]


views.py at photologue_custom

class CustomGalleryListView(ListView):
def get_queryset(self):
    if not self.request.user.is_authenticated():
        print ("User not authenticated")
        return HttpResponseRedirect('/')
    else:
        print ("User authenticated")
        return Gallery.objects.on_site().is_public()
        paginate_by = 20

settings.py
'DIRS': [os.path.join(BASE_DIR, 'mysite/templates',  ), ],

Without customisation it works fine:

urls.py at photologue
url(r'^gallerylist/$',
        GalleryListView.as_view(),
        name='gallery-list'),

views.py at photologue
class GalleryListView(ListView):
    queryset = Gallery.objects.on_site().is_public()
    paginate_by = 20

I have no idea, what to do. Please help.

Problem solved after several hours :) I added a line at views.py:

class CustomGalleryListView(ListView):
    **template_name = 'photologue/gallery_list.html'**

Cool. Glad you worked it out.