Django Admin Page

Create Super User

python manage.py createsuperuser

Nom d’utilisateur (leave blank to use 'kyubong'):
Adresse électronique: [email protected]
Password:
Password (again):
Ce mot de passe est entièrement numérique.
Bypass password validation and create user anyway? [y/N]: y
Superuser created successfully.

Ajouter le champs de "search" dans Admin page

pybo/admin.py

from django.contrib import admin
from .models import Question

class QuestionAdmin(admin.ModelAdmin):
    search_fields = ['subject']

admin.site.register(Question, QuestionAdmin)

https://docs.djangoproject.com/en/3.0/ref/contrib/admin

좋은 웹페이지 즐겨찾기