0

Django Photologue で構築された Web アプリがあります。いくつかの変更を追加したい (Web へのアクセスが制限されている)。新しいアプリケーションを作成しphotologue_custom、例 ( example ) のように他のことを行いました。しかし、「TemplateDoesNotExist at...テンプレート名が指定されていません」というエラーがあります。

**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',  ), ],

道:

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

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

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

カスタマイズしなくても問題なく動作します:

**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

私を助けてください。

4

0 に答える 0