admin model django code example
Example 1: django runserver
python manage.py runserver
Example 2: create super user in django
python3 manage.py createsuperuser
Example 3: show post id on django admin interface
class BookAdmin(admin.ModelAdmin):
readonly_fields = ('id',)
admin.site.register(Book, BookAdmin)
Example 4: what is admin.tabularinline django
from django.contrib import admin
class BookInline(admin.TabularInline):
model = Book
class AuthorAdmin(admin.ModelAdmin):
inlines = [
BookInline,
]