Tutorial by Examples

Everything you need to get started with Django admin is already setup in Django's default project layout. This includes: # settings.py # `django.contrib.admin` and its dependancies. INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes',...
When you created your own Models in a app, they still need to be registered in order to become available in the admin pages. This is done in the admin submodule. If your app was created using manage.py startapp, an admin.py file should already lay in you app module. Otherwise create it. #myapp/a...
Django Admin comes with some Models registerd by default. There a some occasions where you might want to remove a Model from the admin pages. This is done in the admin submodule. If your app wass created using manage.py startapp, the admin.py file should already lay in your app module. Otherwise cr...
from django.contrib.auth.models import User class UserAdmin(admin.ModelAdmin): list_display = ('email', 'first_name', 'last_name') list_filter = ('is_staff', 'is_superuser') admin.site.unregister(User) admin.site.register(User, UserAdmin) We need to unregister before regis...

Page 1 of 1