Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Python to 3.8.2 and Django to 3.0.7 #1507

Merged
merged 5 commits into from
Jun 20, 2020
Merged

Upgrade Python to 3.8.2 and Django to 3.0.7 #1507

merged 5 commits into from
Jun 20, 2020

Conversation

czlee
Copy link
Member

@czlee czlee commented Jun 15, 2020

Closes #1501

Mostly making a PR some there's somewhere to discuss with reference to code, if needed.

czlee added 2 commits June 14, 2020 18:03
Also a bunch of other Django packages
Also, a system check failed because some of the emoji are 3
characters long, so this changes the max_length for the Team.emoji
field to 3.
@czlee
Copy link
Member Author

czlee commented Jun 15, 2020

So… first roadblock! The django-jet package isn't compatible with Django 3. There's a nice loud message on their README: https://github.com/geex-arts/django-jet

Basically, their reincarnation is the new Jet Bridge, which seems way overkill for what we want. It also requires a Jet account, which presumably means that everyone who installs Tabbycat will have to create a Jet account, and it won't just add itself seamlessly by being included in Tabbycat.

Barukimang has patched django-jet for Django 3.0: geex-arts/django-jet#430
But if django-jet's no longer under active development, I'm inclined to say we should ditch it altogether.

Of course, we could just remove Jet altogether and revert back to the original Django admin site for the Edit Database area. But there's a good reason we had Jet in the first place—the Django admin site isn't that friendly (and isn't meant to be).

Or we could find a substitute. Thoughts?

@czlee
Copy link
Member Author

czlee commented Jun 15, 2020

… Otherwise, everything seems fine. Our Travis PR hook is broken, but it happened on the branch: https://travis-ci.org/github/TabbycatDebate/tabbycat/builds/698352467

@tienne-B
Copy link
Member

Not the first time changing DB admin UI: #259 We could try the default; it may have improved.

@czlee
Copy link
Member Author

czlee commented Jun 15, 2020

We could try the default; it may have improved.

Just did. It has not. 😅 But on a quick search, there are countless others!

@czlee
Copy link
Member Author

czlee commented Jun 15, 2020

django-suit has a v2.0 in development that according to this issue is more or less functional, but not polished.

Other packages here: https://djangopackages.org/grids/g/admin-styling/

@czlee
Copy link
Member Author

czlee commented Jun 15, 2020

  • Django Suit 2.0a1 seems alright, if we're prepared to take a punt on a pre-release version that's unlikely to be properly released any time soon.
  • Django Grappelli I'm not really a fan of, for our application.
  • Django Admin Tools doesn't seem right for us at first glance either.

@philipbelesky
Copy link
Member

Only a few of those other packages are themes, and most of them are relatively minimal.

I'd be inclined to stick with the (patched) Jet and push the question back to whenever a future breaking change occurs. By then Suit 2.0 may be released, a Jet fork may be solid, or there may be other options.

@czlee
Copy link
Member Author

czlee commented Jun 18, 2020

I see. My main concern about running with the patched Jet is that I don't think it's officially released on pip (understandably so, given that it's a fork). We could reference Barukimang's repository directly from our requirements file, but I think I'm just worried about the dependency reference potentially breaking one day, since it's not "official", so to speak. For a small project I wouldn't bat an eyelid, but I don't know how many people deploy Tabbycat sites per day these days 🙈

The original django-jet is no longer maintained and isn't compatible
with Django 3. Another user, Barukimang, has made a fork to patch
the parts that aren't Django 3-compatible.

See https://github.com/Barukimang/django-jet/
# Django admin (Jet)
# This is an unofficial fork of no-longer-maintained geex-arts/django-jet,
# patched to support Django 3.
git+https://github.com/Barukimang/[email protected]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philipbelesky Just drawing attention to this line, which is the patched django-jet

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Also to address your comment above, we could always do a fork ourselves if we were concerned about it vanishing or having a breaking update.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we could. I'd describe my concern as more about the consequence than the probability of it happening—I doubt it'll disappear, but if it does, Tabbycat will become undeployable until we release a patch with our own fork.

@czlee czlee marked this pull request as ready for review June 18, 2020 00:42
@czlee
Copy link
Member Author

czlee commented Jun 18, 2020

More digging:

It seems that there are mostly just two changes to the original django-jet repository:

  1. The django.utils.encoding.python_2_unicode_compatible decorator was deprecated in Django 2.0 and removed in Django 3.0.

    • Bakurimang deals with (1) by importing it from six instead (compare)
    • RamsesMartinez deals with (1) by removing it altogether (compare)
    • We don't care for Python 2 compatibility, and Django 3.0 doesn't support Python 2 anyway, so it makes more sense to me to remove it altogther.
  2. The admin_static template tag library was deprecated in Django 2.1 and removed in Django 3.0.

    • Both Bakurimang and RamsesMartinez deal with this by replacing it with static.
  3. RamsesMartinez has also updated a bunch of minified CSS files. I don't know if this would have any effect?

Do you have thoughts on picking an existing fork vs making our own? Having figured out the above, I'm now kind of divided about it. Again, for a personal project I'd just pick one and not worry too much about it, but I guess this isn't really a personal project anymore.

@philipbelesky
Copy link
Member

Using r-django-jet sounds good if it is up pypi. Altered css files should be no problem.

@czlee czlee merged commit 71da6ff into develop Jun 20, 2020
@czlee czlee deleted the feature/django-3 branch June 20, 2020 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to Django 3.x
3 participants