- changed title to Move to Django 2.2
- edited description
- changed milestone to 1.0.0
Move to Django 2.2
Django 1.8 ended extended support in April 2018. The last series 1 release (and last to support Python 2.7 ends extended support in April 2020.
Django 2.2 LTS is supported through to April 2022.
Django 3.0 will be released in December 2019, but will only be supported until April 2021. Better to target 2.2 LTS until 3.2 LTS is available in about April 2021.
Comments (50)
-
reporter -
reporter Disabled pynetdicom testing for now. All other tests pass. Need to work out Python 3 testing rig on bitbucket. Refs
#404,#777,#457,#530[skip ci] Not ready for testing. Next task - move to Django 1.9...→ <<cset e13fda4c134e>>
-
reporter Attempt to run tests on bitbucket with Python 3.6, Django 1.8. Refs
#404,#457→ <<cset 42b14ccd9830>>
-
reporter Hadn't copied changes to local_settings to the example. Refs
#404,#457→ <<cset 068a4e43c735>>
-
reporter Django 1.9, added new --parallel switch to test. Refs
#404,#457→ <<cset 8d917f24870f>>
-
reporter See if this moves the pipeline on further... Refs
#404,#457→ <<cset 6236b8c99966>>
-
reporter @David Platten (or anyone else!) - I could do with some help!
With Django 1.9 makemigrations checks
urls.py
for errors before creating the database change instructions.urls.py
imports various things fromviews.py
for the class based views. Some of the classes inviews.py
make use ofSingletonModels
and do a preliminary check to see if the item exists.Which is where it all goes wrong, because the item doesn’t exist because the database doesn’t, and when we try to create it everything falls over.
The two checks in question are in
RFHighDoseAlertSettings(UpdateView)
: here and inSkinDoseMapCalcSettingsUpdate
: here. You will notice that for the first of these, I have changed the method of checking but it makes no difference.We either need to not do this test, or not do it there, or something to prevent it being executed during
makemigrations
.If you want to run the code, you’ll need to create a Python 3 venv (I’m using Python 3.6), checkout the
p3django1.9
branch andpip install -e path/to/openrem/folder
to get the right versions of everything. Then start a new database (same with SQLite3 and postgresql) and clear out the previous migrations fromopenrem/remapp/migrations/0*
. Then do apython manage.py makemigrations
call.If I simply comment the two checks out,
makemigrations
works fine… -
reporter @David Platten @Luuk - With the same setup, I also can’t get the class-based views working with forms. I’ll carry on hitting it, but if one of you (or anyone else) can get there first, I’d very much appreciate it!
-
@Ed McDonagh I’m setting up a python 3 install on my Windows test system. Do I need to install pynetdicom to test this branch? Trying to install it via pip gives an error message.
-
reporter No, leave pynetdicom for now. I’m planning to start again with the new pynetdicom when I’ve got everything else up to latest Django.
-
Migration now works. Not sure whether this will cause further problems. References issue
#457.→ <<cset 6992f774fb0f>>
-
reporter Thanks @David Platten - I saw that solution at some point on my journey but didn’t try it! I think it is safe enough - I don’t think we would expect to see
ProgrammingError
in other circumstances.Now, any ideas about why there is no
form
component in class based form views…? -
If you comment out the “get_context_data” function in views.py, and remove the check for admin group in the html template then the forms work (at least, the skin dose map settings one does).
I think that the error is thrown when the “get_context_data” part of the view returns the context; this doesn’t contain any “form” data so the error is thrown. I don’t know how this is handled in the older django/python version.
-
Skin dose map form now working. References issue
#457→ <<cset d62563a06542>>
-
Fixed all broken CreateView and UpdateView methods in views.py. References issue
#457→ <<cset 70f4a62b3514>>
-
reporter Awesome. Thanks @David Platten !
-
reporter Dropping urls.patterns as deprecated. Refs
#457→ <<cset 242b6247cee6>>
-
reporter Replaced django.db.models.sql.aggregates with django.db.aggregates as per deprecation warning. Refs
#457→ <<cset d354c4fbdb31>>
-
reporter Pycharm doesn't like it, but it works and the deprecation warnings go away.... Refs
#457→ <<cset d4a2524f6421>>
-
reporter Allow initial migrations for SQLite3 databases - seems to use a different error. Refs
#457→ <<cset bda812588866>>
-
reporter Old way of enabling admin site deprecated. Refs
#457→ <<cset 3b4394dff068>>
-
reporter Onto django 1.10. Refs
#457→ <<cset 45524d1a8369>>
-
reporter render_to_response removed deprecated. Refs
#457→ <<cset e7a554885bd3>>
-
reporter Admin site for not-patient-indicators syntax no longer working, but not being used so removed. Refs
#457→ <<cset 51b8aaf9bafa>>
-
reporter Setup for Django 1.11. Refs
#457→ <<cset df3982c7eba5>>
-
reporter Migrated django-filter to version 2 now we have Django 1.11. Refs
#437,#457→ <<cset a7bba4b9b343>>
-
reporter See if this is still necessary. If it is, then get_solo() will work better. Refs
#457→ <<cset b5e5d86fc33d>>
-
reporter SkinDOseCalcSettings not required, so removed. Need to sort out default ordering for filtered pages next. Refs
#404,#457→ <<cset 4c7398796724>>
-
reporter AAdding on_delete to ForeignKey and OneToOneField. Refs
#457RemovedInDjango20Warning: on_delete will be a required arg for ForeignKey in Django 2.0. Set it to models.CASCADE on models and in existing migrations if you want to maintain the current default behavior. See https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.models.ForeignKey.on_delete→ <<cset e9782765b8cf>>
-
reporter Importing from django.core.urlresolvers is deprecated. Refs
#457→ <<cset 542057233de5>>
-
reporter Chnage to how admin site urls are included - still need to fix namespace not being unique. Refs
#457→ <<cset 817bf247f907>>
-
reporter assertAlmostEquals deprecated for assertAlmostEqual. Refs
#457→ <<cset 89cbc00c6905>>
-
reporter MIDDLEWARE_CLASSES deprecated for MIDDLEWARE. Refs
#457→ <<cset 2347e65026d2>>
-
reporter assignment_tag deprecated in favour of simple_tag. Tested with RF alerts. Refs
#457→ <<cset 003264d2fe4c>>
-
reporter Replaced all uses of admin in remapp/urls.py due to namespace admin not being unique - turns out was duplicate import in openremproject/urls.py. Refs
#457Remaining fix before moving to 2.0 is ordered queryset in pagination.→ <<cset 5d77f3436a41>>
-
reporter Default ordering now time and date from newest; order_by choices now use time and date too. Refs
#457,#437→ <<cset e45df4a789d1>>
-
reporter Bumping Django version to 2.0. Refs
#457→ <<cset 97e43b1e0b2d>>
-
reporter user.is_authenticated no longer a method, now a property. Refs
#457→ <<cset 123dd6914f36>>
-
reporter Python 3 only now, so need to remove encoding to utf-8. Seems all values in database might be bytes though... Refs
#457→ <<cset 15add7014ea6>>
-
reporter Changed everything from dicom to pydicom. Attempted to remove all byte warnings - elements with VR UN are imported as bytes. Existing db data might be bytes too. Refs
#457,#404,#777→ <<cset 6bd11d6314da>>
-
reporter Starting to tidy up urls.py using the new path syntax. Refs
#457→ <<cset 2358f9531a7d>>
-
reporter Finished moving to path for urls.py. Refs
#457→ <<cset 1e818ff8942e>>
-
reporter Fixes to auth views for Django 2.1, bumping version number. Nothing in deprecation warnings for OpenREM. Refs
#457→ <<cset 1a6bf9b7926a>>
-
reporter Bump to 2.2! Hoorah! Fixed issue with multiplication between float and Decimal. Refs
#457→ <<cset 2c6e3718d229>>
-
reporter Replacing render_to_response with render in dicomviews. Refs
#530,#457, [skip ci] as QR tests currently disabled.→ <<cset 03aa4dc22cfc>>
-
reporter Correcting error in urls, attempting to ignore importing from local_settings without using them. Refs
#404,#457→ <<cset d9ff394bf127>>
-
reporter - changed status to resolved
Merged in p3django2.2 (pull request #337)
Update develop to Python 3, Django 2.2
Refs
#530, fixes#404,#437,#457,#777→ <<cset 1fc70f28f05e>>
-
reporter Adding changes that should have been made in pull request #337 / commit 1fc70f2. Refs
#404,#437,#457,#777. Also ref#787added to CHANGES. [skip ci] docs only→ <<cset 6fea154d0fe2>>
-
get_model() not supported anymore in Django =>1.9. Refs
#457.→ <<cset ec4045fedd3f>>
-
reporter Merged in issue457django22_median (pull request #348)
get_model() not supported anymore in Django =>1.9. Fixes
#457.Approved-by: Ed McDonagh
→ <<cset fbb32a756ecd>>
- Log in to comment
Updated Description.