Hacker News new | past | comments | ask | show | jobs | submit login
A Bootstrap theme for Django Admin (codingnot.es)
86 points by riccardoforina on Nov 16, 2012 | hide | past | favorite | 19 comments



While there is a place for this, there should also be a caveat. You are essentially forking django-admin - at least all the templates for it. Someone will have to keep that synced with any changes to Django going forward.

I stuck to a much lighter 'CSS only' theming of the Django admin which is less likely to need a lot of work to track changes to Django core.


This is correct. Unfortunately no bootstrapping can be done to the actual html code without rewriting it. Or, to be more precise, no _good_ bootstrapping can be done.

I hope this app can invite to a refactoring of the django-admin app to render themes more feasible without too much hassle.


Yep. There's definitely some architectural changes to the admin that would aid in re-theming.

More functionality encapsulated in template tags or the use of class-based views to facilitate reuse. Or even split the Admin into an API and an replaceable front-end. (a front-end to the back-end if you get my drift).

Lots of the admin would be nice to reuse for non-admin CRUD apps. Actions, list-filters, changelist, hierarchical date stuff, inlines...

In many ways the admin code is amazingly malleable and open to reuse in many areas. It's just that it's rather inconsistent and some other areas are extremely hard to reuse. Woe betide you if the thing you want to customize is in the latter category.


Combine this with Crispy Forms on the user side and you get a good looking app in minutes!

http://django-crispy-forms.readthedocs.org/en/d-0/


As a Django user I appreciate this, every contribution to the Django ecosystem helps. Thanks.

But I have a question, why do you decide to create this project instead of contribute to others with the same objective? https://github.com/douglasmiranda/django-admin-bootstrap https://bitbucket.org/salvator/django-admintools-bootstrap and https://github.com/aobo711/bootstrap-django-admin


Good question. I tried every one of them I could find, none matched my needs: working only on the template side without strange settings or url tweaking.

I see that douglasmiranda is using the same logic, but I wrote this code in May. Is just my Github submission that's old. Maybe we can merge things :)


I've found that the Django admin will usually only get you so far. After a certain point you really have to break out of the built-in change_list's etc to efficiently get what you need.

I still use the admin as a wrapper but for a lot of the views I've written my own handling.


I think we pretty much agree but I'd like to clarify as I often hear people argue something along the lines of "the admin is great for simple things but you'll have to write normal code for anything beyond simple CRUD"

In fact - you can slot custom functionality into the admin in so many ways that even with a highly custom set-up you're still getting a lot of benefit from using it.


One minor visual thing:

The Bootstrap Navlist .well has some inline style to remove the padding, so the blue highlight goes from side to side.

    padding: 8px 0px;
It's a bit weird that it's not in the actual Bootstrap code, but that's what they have in their doc example (to be exact, they don't show that in the example code listing, but if you examine the example it has that code).


Can you open an issue for this please (maybe with a screen)? I keep forgetting to check it.


This is been a long time coming, and this is probably the best way to go about it - which also lets the Bootstrap people to handle most of the front-end.

Installation needs to be a little easier for this to catch on, but I think this will be the unofficial official admin look just like django-registration is the unofficial official account back-end. :)


Thank you sir! I uploaded the package on pypi a couple of minutes ago, you should now be able to do:

pip install django-admin-bootstrapped


Awesome. Consider it a part of my project by default. :)


Not perfect, but looks much better. I'm always embarrassed to show people the default admin... with its cyan and yellow header, yuck. Yes it can be changed, but when writing a new app you've already got more than enough to do.

How to get one of these bootstrap themes shipped as the default? Any Django core developers here?


This looks fabulous; I am currently working on a site that uses Django and Bootstrap (my first site with Django actually), and I haven't veered too far from what comes standard with Django. I hope to try plugging your templates into our site this weekend!


For those using Rails, there's [hobo_bootstrap](https://github.com/Hobo/hobo_bootstrap)


As much as people love bootstrap nowadays, I don't feel this improves the admin UI, in fact, it worsens it. Just looking at the screenshots I can find a dozen flaws. Need more polishing to be usable.


why use it instead of Grappelli? http://www.grappelliproject.com/


Grappelli is a full app, and you end up tying your project to it if, for example, you use the inline sorting functionality.

Mine is just a theme, you can turn it off whenever you want.

It really just depend on what you need :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: