Question

I recently setup django-grappelli on my first django app. While I like the way it looks I want to customize the colors, and other CSS.

From my research, it looks like I will have to use Compass but I've never used Compass before and want to double check that this is the best method before I embark on that path!

Is Django-grapelli even the right choice for some one that wants to customize the color theme?

Things I tried

  1. Modify the CSS in the Grappelli stylesheets but they are formatted in a way that makes it tedious.
  2. Extend the style sheet but I am not sure where to do this for the admin.
  3. Create a custom.css but could not figure out where to put the path

Thanks for your advice!

Was it helpful?

Solution

It seems to me like Compass is just a tool to write CSS. I've never used it, but at the moment I don't see how it could make modding the admin interface any easier than doing it manually!

Whenever I make changes to the admin (I've made changes to Grappelli, like you're trying to do), I always use what you've listed as number 2. I've never had any troubles! I can try to help you out, if you'd like to try again.

What I do first is go to my Python install directory and copy the Grappelli source from Lib/site-packages. I put this code in my project directory as a project-level app. So, if you're using Django 1.4, you'll have a folder that has your project folder as well as manage.py in it. Put the code there.

Then, using your favorite web developer tools (I prefer Chrome's), figure out which stylesheet you need to modify and which css file it's in. I do this by right-clicking the element and selecting Inspect Element. This brings up the dev tools, and at the right it tells you the css file its referenced from as well as which line its on. If you open up that css file in your favorite text editor and make changes to it, it should work!

Let me know if you're having any trouble with this. I can try to help you out further.

(and, P.S., I wasn't trying to be pedantic with a basic overview of the use of Chrome's developer tools. I was just trying to be helpful by not assuming anything. I hope you don't take it as an insult.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top