Django - customisation doesn't work at Photologue

227 Views Asked by At

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 and did other things as in example (example). 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',  ), ],

Path:

/home/celinaitomek/wedding-gallery/mysite -> my app

/home/celinaitomek/wedding-gallery/photologue -> photologue

/home/celinaitomek/wedding-gallery/photologue_custom/urls.py -> photologue_custom

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

Please, help me.

0

There are 0 best solutions below