dimanche 20 octobre 2019

Site doesn't show admin panel when i write http://localhost:8001/admin/

Site doesn't show admin panel. What should I do?

Page not found (404)
Request Method: GET
Request URL:    http://127.0.0.1:8001/admin/
Raised by:  news.views.PageViews

With what it could be connected? I don't know what to do.

class PageViews(ListView):
    template_name = 'page.html'
    paginate_by = 8
    context_object_name = 'posts'
    ordering = ['-datetime']
    model = Page
    paginate_orphans = 1

    def dispatch(self, request, *args, **kwargs):
        slug = kwargs.get('slug')

        try:
            self.category = Category.objects.get(slug=slug)
        except Category.DoesNotExist:
            raise Http404

        return super().dispatch(request, *args, **kwargs)

    def get_queryset(self):
        return Page.objects.filter(category=self.category)



Aucun commentaire:

Enregistrer un commentaire