elky / django-flat-theme

A flat theme for Django admin interface. Modern, fresh, simple.
Other
413 stars 46 forks source link

[Suggestion]: Fail loudly when trying to install on Django>=1.9 #36

Open filwaitman opened 5 years ago

filwaitman commented 5 years ago

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.

fabiocaccamo commented 5 years ago

@filwaitman I suggest you to try django-admin-interface, it is based on django-flat-theme for older django versions and does exactly what you need.

filwaitman commented 5 years ago

@fabiocaccamo thanks for the quick reply!

I'm not sure if I made myself clear. My scenario is: 3-4 years ago I started a project in Django 1.8 and decided to use django-flat-theme. Last week (yes, it took a long time :laughing: ) I decided to upgrade Django to 1.11 and all my third party libraries.

What I got: My admin interface became inconsistent, JS and CSS weren't loading properly for no reason. After a while I realized that my manage.py collectstatic was pointing to duplicated files (for instance the SelectFilter2 I sent above)... removed the django-flat-theme from INSTALLED_APPS and fixed everything.

What I'm suggesting: As soon as I try to upgrade django-flat-theme, setup.py (or some similar technique) identifies that Django>1.9 is present, and raises an error like "Don't install it from scratch, django-flat-theme is part of Django since 1.9".

What do you think?

fabiocaccamo commented 5 years ago

@filwaitman I understood your scenario, I had your same problem while testing django-admin-interface on different django versions.

Here you can see how I solved it: https://github.com/fabiocaccamo/django-admin-interface/blob/master/admin_interface/settings.py

filwaitman commented 5 years ago

@filwaitman a ha! So I misread your first comment. =P That's precisely what I was thinking. I'm gonna land a PR with that. Thanks!

fabiocaccamo commented 5 years ago

@filwaitman why you need to land a PR? it's already done...

filwaitman commented 5 years ago

It's done for django-admin-interface, not for django-flat-theme, right? I would like to see my installation fails if I try to install/upgrade django-flat-theme when using Django>=1.9.

fabiocaccamo commented 5 years ago

django-admin-interface uses django-flat-theme under the hood, so your installation will fail as expected :)

filwaitman commented 5 years ago

Yes but the problem is: I wasn't using django-admin-interface. I was using pure django-flat-theme.

I upgraded django + another 50 third party libraries, it's a though work to look individually to each of them and check whether or not I should flip to another library at that point. I would love to simply upgrade django-flat-theme (again, nothing related to django-admin-interface at this point) and see it failing so I could see easily that this is "incompatible" (actually "no longer needed") for django>=1.9.

This is not about "use library X, it suits your needs best". This is about upgrading a super old version of some third party library I decided to use 3-4 years ago.

fabiocaccamo commented 5 years ago

Send a PR and hope it will be merged.