Django: Getting Started Transcripts
Chapter: 3rd Party Libraries for Django
Lecture: Django Admin styling with Grappelli
Login or purchase this course to watch this video and the rest of the course contents.
0:00 The first package that I'm going to demo for you is Grappelli. It's a restyling of the Django admin,
0:06 replacing all the admin templates with new ones that are slicker and more modern. The docks for Grappelli are at django-grappelli.readthedocs.io.
0:17 Let's open up PyCharm and install Grappelli. The first step is to install the package using pip install. In case you're curious about the name.
0:32 The Django package is named after the jazz musician Django Reinhardt. So when it came to building a new gooey for the admin,
0:39 the Grappelli packagers thought it only appropriate to name it after Djangos musical partner, Stephane Grappelli.
0:45 Grappelli is a Django app that has overloaded the templates used by the Django admin. As it is an app, you need to tell Django it's there,
0:58 you do this by adding it to installed apps like any other app. It's very important that this one goes before the Django contract admin app.
1:07 Usually it doesn't really matter what order you have here. But in this case Grappelli needs to take precedence over the admin.
1:14 Grappelli also has some views of its own. You're going to need to register its URLs. The next step is to include a path.
1:22 Let me open up alexandria URLs.py. And like with the install apps, this declaration needs to go before the admin path as well.
1:38 Grapplli's interface includes some images and things that are included as static files. If you were installing this library in a production server,
1:46 you'd also have to run the collect static command. But you're probably going to have done that anyhow for your own stuff.
1:53 All right, all that configuration is done. Let's go take a look at the result.