Home > Backend Development > Python Tutorial > How to add authentication to a Django custom admin view?

How to add authentication to a Django custom admin view?

PHPz
Release: 2024-08-02 02:23:02
Original
868 people have browsed it
How to add authentication to a Django custom admin view? How to add authentication to a Django custom admin view?
How to add authentication to a Django custom admin view?
0
How to add authentication to a Django custom admin view?

I created a custom admin view in django for one of the models. But the url is available to anyone who is not logged it.

from django.contrib import admin
from django.urls import path
from django.shortcuts import render, redirect
from .models import Question
from django.contrib.admin.views.decorators import staff_member_required
class QuestionAdmin(admin.ModelAdmin):
    list_display =
Copy after login
Open Full Question

The above is the detailed content of How to add authentication to a Django custom admin view?. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template