junction icon indicating copy to clipboard operation
junction copied to clipboard

Upgrade Django to 2.2 LTS

Open dishantsethi opened this issue 6 years ago • 8 comments

The things we'd need to do here are:

  • [ ] Resolve the deprecation warnings.
  • [ ] Upgrade to Django 1.11, and bump all dependencies. #664
  • [ ] Upgrade to Django 2.2, and bump dependencies. #687

dishantsethi avatar Jul 27 '19 16:07 dishantsethi

Hey @zerothabhishek, Is this a legit issue? Should Junction be upgraded to latest version of django?

dishantsethi avatar Aug 30 '19 15:08 dishantsethi

I could take this up and migrate Django to 3 altogether.

It would be a good starting point for me to have a better understanding about each component of this project.

sks444 avatar Mar 20 '20 20:03 sks444

This is basically a critical task.

The things we'd need to do here are:

  • Resolve the deprecation warnings.
  • Upgrade to Django 1.11, and bump all dependencies.
    • This will be the tricky step, because our current dependency graph isn't a known good set
  • Upgrade to Django 2.2, and bump dependencies.

Thanks to an utter lack of tests, we'd need to do manual A/B tests for differences between the versions.

pradyunsg avatar Mar 23 '20 12:03 pradyunsg

After https://github.com/pythonindia/junction/pull/653, I started working on fixing third party deprecation warnings and upgrading to Django 1.11.+. And one of the first issues I encountered is:

We are using django-uuidfield at devices models.

The problem is django-uuidfield uses SubfieldBase from django.db.models which has been removed:

  File "/Users/sks/sks444/junction/junction/devices/models.py", line 7, in <module>
    from uuidfield import UUIDField
  File "/Users/sks/.virtualenvs/junction/lib/python3.7/site-packages/uuidfield/__init__.py", line 8, in <module>
    from .fields import UUIDField
  File "/Users/sks/.virtualenvs/junction/lib/python3.7/site-packages/uuidfield/fields.py", line 4, in <module>
    from django.db.models import Field, SubfieldBase
ImportError: cannot import name 'SubfieldBase' from 'django.db.models' (/Users/sks/.virtualenvs/junction/lib/python3.7/site-packages/django/db/models/__init__.py)

And now the package is not maintained. There is a pr fixing this issue, also I found this fork which I think is a merge of this pr.

So what should we do in this case, should we deploy this to our own pypi, fixing the issue? Suggestions @pradyunsg, @palnabarun, @ananyo2012 ?

sks444 avatar Apr 04 '20 22:04 sks444

I have 0 interest in maintaining a fork.

Doesn't Django have a UUIDField built in? https://stackoverflow.com/questions/32528224/#32528292

pradyunsg avatar Apr 05 '20 00:04 pradyunsg

Yep @pradyunsg is right. Django has uuid field for models - https://docs.djangoproject.com/en/1.11/ref/models/fields/#uuidfield

ananyo2012 avatar Apr 05 '20 04:04 ananyo2012

I'll let someone else handle writing the migration for this lol.

pradyunsg avatar Apr 05 '20 04:04 pradyunsg

Okay, so we'll move to Django's UUIDField and figure out a way to migrate old data to this.

sks444 avatar Apr 05 '20 07:04 sks444