Quickstart¶
Install the pip package:
pip install django-adminlte2
Add the apps to INSTALLED_APPS
:
INSTALLED_APPS = [
# The general purpose templates
'django_adminlte',
# Optional: Skin for the admin interface.
# Note: Must appear before 'django.contrib.admin'
'django_adminlte_theme',
'django.contrib.admin',
# everything else
]
If you only wish to skin the admin interface, you can stop here. Your admin interface should now be displaying with the AdminLTE theme.
You can also make use of the AdminLTE theme for your app. This may be particularly useful for internal (non-public) apps which need a quick and effective layout.
Using the templates in your app¶
The base AdminLTE template provides much of what you need, but you’ll need to customise it in some ways to meet your needs. In particular, no navigation is provided (we’ll cover this shortly).
To add & modify the functionality of the base template you should create your own base
template. This template should extend adminlte/base.html
. Several blocks are available
for you to extend.
{% extends 'adminlte/base.html' %}
{% block title %}My App{% endblock %}
{% block content %}
Just some example content
{% endblock %}
Take a look at the base template to see the available blocks.