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
PHPzOriginal
2024-08-02 02:23:02848browse
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 =
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!

Statement:
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
Previous article:Be A Millionaire...Next article:Be A Millionaire...