Customizing Django Admin Interface

Bharat Saraswat

Agenda

  • Introduction to Django and Django Admin Interface
  • Reusable options and methods provided by Django
  • Django admin themes

Basically, What? Why? and How?

What does django code look like?

Creating a Django project

$ django-admin startproject mysite

Creating a Django project

mysite/
    manage.py
    mysite/
        __init__.py
        settings.py
        urls.py
        asgi.py
        wsgi.py

Starting development server

$ python manage.py runserver
from django.db import models

class Person(models.Model):
    first_name = models.CharField(max_length=30)
    last_name = models.CharField(max_length=30)
CREATE TABLE myapp_person (
    "id" serial NOT NULL PRIMARY KEY,
    "first_name" varchar(30) NOT NULL,
    "last_name" varchar(30) NOT NULL
);

References

  • Packages for admin styling: https://djangopackages.org/grids/g/admin-styling/
  • https://realpython.com/customize-django-admin-python/
  • https://docs.djangoproject.com/en/3.1/ref/contrib/admin/
  • https://docs.djangoproject.com/en/3.0/ref/contrib/admin/#multiple-admin-sites-in-the-same-urlconf
  • https://docs.djangoproject.com/en/3.0/topics/templates/

Thank You

🙏

Bharat Saraswat

bhansa

@293bharat

Customizing Django Admin Interface

By Bharat Saraswat

Customizing Django Admin Interface

  • 705