mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-25 17:06:01 +03:00
[PR #1333] [MERGED] Upgrade Django (Django-1.10 no longer supported) #2194
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#2194
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/modoboa/modoboa/pull/1333
Author: @ghost
Created: 12/19/2017
Status: ✅ Merged
Merged: 12/21/2017
Merged by: @tonioo
Base:
master← Head:upgrade-django📝 Commits (10+)
e6befb3standardise travis.yml across modoboa extensions3308c56StopIterator has been depreciated, use return [PEP479]892160dupdates for django 1.11 supporte8eb9a8passlib 1.7 depreciated the use of .encrypt(), use .hash()0cd444bdjango-reversion >= 2.0.0 should be used with django >= 1.82e18acbupgrade django-auth-ldap and fix depreciated warningba86196upgrade dependencies with minor version updates8fb3e24upgrade to django 1.114fe51d6random code clean ups33b37ecupdated new deployment settings.py📊 Changes
70 files changed (+300 additions, -241 deletions)
View changed files
📝
.travis.yml(+20 -13)📝
ldap-requirements.txt(+1 -1)📝
modoboa/admin/forms/account.py(+1 -3)📝
modoboa/admin/forms/domain.py(+1 -1)📝
modoboa/admin/handlers.py(+1 -1)📝
modoboa/admin/migrations/0001_initial.py(+12 -12)📝
modoboa/admin/models/alias.py(+7 -5)📝
modoboa/admin/models/domain_alias.py(+2 -1)📝
modoboa/admin/models/mailbox.py(+5 -4)📝
modoboa/admin/models/mxrecord.py(+5 -5)📝
modoboa/admin/templatetags/admin_tags.py(+1 -1)📝
modoboa/admin/tests/test_account.py(+1 -1)📝
modoboa/admin/tests/test_alias.py(+1 -1)📝
modoboa/admin/tests/test_api.py(+1 -1)📝
modoboa/admin/tests/test_domain.py(+1 -1)📝
modoboa/admin/tests/test_domain_alias.py(+1 -1)📝
modoboa/admin/tests/test_export.py(+1 -1)📝
modoboa/admin/tests/test_import_.py(+1 -1)📝
modoboa/admin/tests/test_mailbox_operations.py(+1 -1)📝
modoboa/admin/tests/test_mx.py(+1 -1)...and 50 more files
📄 Description
Django 1.10 is now no longer supported, this PR upgrades modoboa to Django 1.11 (the last version of Django to support Python 2). There's an associated PR for each of the extensions to upgrade them as well.
I've split this into several patches to make it easier to follow:
e6befb3: make all the travis.yml settings the same across modoboa projects. Adds testing against Python 3.5 and enables most Python warnings, the warnings don't affect the test results but they do give you a heads up about things that are depreciated or wrong.3308c56: PEP479 depreciated StopIterators, they should be replace with return.892160d: fixes to support Django 1.11 (and 2.0)MIDDLEWARE_CLASSES is replaced by MIDDLEWARE
add MiddlewareMixin to modoboa middlewares
on_delete will become a required parameter for ForeignKey() set it to the current default CASCADE
on_delete will become a required parameter for OneToOneField() set it to the current default CASCADE
reverse and reverse_lazy have moved to django.urls
RadioChoiceInput widget has been removed, replace with HorizontalRadioSelect
e8eb9a80cd444b2e18acbba86196: upgrade dependencies and fix any errors/warnings.8fb3e24: upgrade Django, the minimum version is pinned to 1.11.8 as this is the latest version that I've done the upgrade with.4fe51d6: random code cleanups.removed duplicate imports
whitespace fixes
removed unnecessary u"" prefixes
added missing r"" prefixes where required
added missing default values to DynamicForm() to prevent possible unassigned variable access
33b37ec: updated settings.py for new deploymentsupdated Django documentation urls to point to the current version
renamed MIDDLEWARE_CLASSES to MIDDLEWARE, MIDDLEWARE_CLASSES is depreciated in Django >= 1.10
whitespace and #noqa fixes
92963a0: updated test_project, synced with a fresh deployment using Django 1.11.8 and updated settings.py so the tests environment matches a fresh deployment.There is one remaining warning for Django 2.0 support in urls.py (example):
RemovedInDjango20Warning: Specifying a namespace in django.conf.urls.include() without providing an app_name is deprecated. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.The simple fix from the description is to add
app_name = "modoboa"to urls.py however this then requires every (and there's a lot of them)reverse("<url>")orreverse("<namespace>:<url>")to be prefixed with<app_name>. The documentation is very thin for this feature so I'm not sure what's the best solution, it's not a real issue until you upgrade to Django 2.0.Extension PRs
When this is merged extensions will need their requirements.txt updated to point at this version as a minimum for modobo.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.