admin customizing

Shin Woohyun·2021년 7월 14일
0

admin page를 커스터마이징해서 원하는 정보들을 전부 볼 수 있다.

admin.py

from django.contrib import admin

from .models import Flight, Airport, Passenger

# Register your models here.
class FlightAdmin(admin.ModelAdmin):
    list_display = ("id", "origin", "destination", "duration")

class PassengerAdmin(admin.ModelAdmin):
    filter_horizontal = ("flights",)

admin.site.register(Airport)
admin.site.register(Flight, FlightAdmin)
admin.site.register(Passenger, PassengerAdmin)


https://youtu.be/YzP164YANAU
https://developer.mozilla.org/ko/docs/Learn/Server-side/Django

0개의 댓글