Django Flat Theme
django-flat-theme is included as part of Django from version 1.9!
Please use this app if your project is powered by an older Django version.
Description
django-flat-theme brings fresh air to the default Django Admin interface which hasn't changed in 10 years, since the very first version of Django framework. This theme makes the UI modern and clean.
This app overrides the default admin's CSS. All the changes only involve CSS: colors, margins, sizes and icons; nothing major is changed.
Installation
Install via pip: pip install django-flat-theme
Put
flat
app in your INSTALLED_APPS beforedjango.contrib.admin
:INSTALLED_APPS = ( ... 'flat', 'django.contrib.admin', ... )
Enjoy!
Compatibility
Works properly in Django 1.5+.
Font
This theme uses the Roboto font which is under Apache 2.0 licence.
Testing
Tested in:
- Internet Explorer 7+ (IE8 and less doesn't support SVG so icons are not displayed)
- Firefox 30+ (Windows, Ubuntu, OS X)
- Chrome 35+ (Windows, Ubuntu, OS X)
- Safari 8 (OS X)
Screenshot Examples
Login page
Dashboard
List of objects
New object
Mobile responsive?
This is really awesome! The flat design made me think the CSS made everything mobile-responsive out of the box, but it turns out that's still yet to be implemented :confused: Is responsiveness on the roadmap?
Change icons to something modern
Have a desire to replace the current icons in the interface (with something like Font Awesome). But I see that there is an additional branch with the same purpose. There is a sense in completion, or the author has completed and will soon be merging?
Custom colors and logo
Hi, thanks for this theme, I think it is one of the best and modern Django admin themes available.
Generally for each client I add a custom logo and I set 2 custom colors, a light and a dark one.
It would very nice having the possibility to customize these 3 things using settings.py or by providing an small admin panel for the theme.
What do you think about it?
django-admin-tools menu compatibility?
It would be great if this theme could (eventually) be compatible with the drop-down menus provided by django-admin-tools.
I understand you can't support compatibility with every other admin modification plugin, but my impression is that django-admin-tools in particular is mature and widely used.
https://pypi.python.org/pypi/django-admin-tools
Thanks for a great package.
Action select box height is to small
The current select box that is displayed above a list for selecting an action is to small to display the text properly.
Screenshot with german locale:
Not working at production stage
Hi, for some reason django-flat-theme it is not working at production stage, it is strange because "flat" it is setted in base.py before django.contrib.admin, and the same file it is used by production and dev. Any ideas ??? Thanks a lot !
Declare that django-flat-theme supports Python 3
caniusepython3.com reports it as unsupported, while it obviously works. It would be nice to add the trove classifiers to setup.py. See https://github.com/brettcannon/caniusepython3#how-do-you-tell-if-a-project-has-been-ported-to-python-3 for details or just steal it from Django.
ValueError: bad marshal data (unknown type code)
Please, do not use in the MANIFEST.in instructions that's like this:
In this case, all files will be included into the package distribution. For example, such as the files: *.pyc, .DS_Store. Because of this, when I installed this package with the following command:
I got an error:
It is best to explicitly specify the file extensions to be included in the distribution. For example:
Great job!
Hey Elky,
I'm just opening this issue to let you know that I really like your job and am thankful for what you've done! I hope it'll make into Django 1.9 and everyone will enjoy your work! Молодец, так держать!
Layout problem on multiple element by line admin rendering
Hi,
I'm having (with my French up to date Firefox Linux & Windows) issues on rendering.
I may be cause of the problem as I added chosen widget…
[edit] I am the cause of the problem, my widget need to disable overflow hidden in form row and it does it automatically… and if I use !important to overflow hidden, my widget don't work properly as it can't pop from the line…
I agree it's not really your issue but I don't really know how to handle my MixIn which works pretty well in classic admin.
Do you think of a work around for advanced admin user injecting widget relying on classic overflowing style?
"/static/admin/img/tooltag-arrowright.png" is a gif in <1.7
Can't use django-flat-theme atm, since the above file doesn't exist as a .png in 1.6:
Ensure INSTALLED_APPS sanity for flat app according to Django version
Closes https://github.com/elky/django-flat-theme/issues/36
This solution is similar to https://github.com/fabiocaccamo/django-admin-interface/blob/master/admin_interface/settings.py
[Suggestion]: Fail loudly when trying to install on Django>=1.9
Hi there!
I was wondering if it would be nice force an installation error when Django>=1.9 is present.
This may (or may not, IDK) be a rare scenario but take my case as an example: I just upgraded a project from Django 1.8 to Django 1.11... and my Django admin interface was... well... misbehaving. It took me a considerable amount of time to understand that that was being caused by conflicts between (in my case) this and that.
If you guys agree this is a good idea I'll be happy to implement the changes, if needed.
Providing `base_site.html` breaks compatibility with end-user projects.
As mentioned here: https://github.com/elky/django-flat-theme/commit/49c9b059de3398577417234399a94b5a6ece4c30
This change probably breaks compatibility with any existing project that defines their own
admin/base_site.html
template, which I believe is the recommended way for people to extend the Django admin template without duplicatingbase.html
.Changing the order of
INSTALLED_APPS
won't help. It's either ourbase_site.html
or yours.Is there another way you can implement
django-flat-theme
without adding theflat-theme
class directly to thebody
tag in this template? Maybedjango-flat-theme
can just live without it? Or you could duplicate thebase.html
template. That would be ideal for people wanting to usedjango-flat-theme
with their own projects, as it would remain more of a drop in replacement.Display of fields on the same line
From: https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.fieldsets
As you can see the labels are closer to the preceeding input than they are to their own: https://drive.google.com/file/d/0B_afp8i9IOxeNDZlcWZ5ZDdvTTg/view?usp=drivesdk
I think this was also an issue with the old admin css but now might be a good time to address it.
I'm not sure what the best fix is. However - it should be possible to target form-rows with multiple fields using a variant of this technique: http://stackoverflow.com/questions/8720931/can-css-detect-the-number-of-children-an-element-has
I suggest either:
some ideas
I have spent sometime with the flat theme, great work. Here's some thoughts that might be worth a thought
I'm not sure where django's admin style is heading, but if it is eager to include something like flat into core, it would be nice to have something more flexible than another (yet slick :+1: ) set of css files :-)