-
Notifications
You must be signed in to change notification settings - Fork 618
Upgrade to Django 2.2. #1830
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 to Django 2.2. #1830
Conversation
580250d
to
d302197
Compare
@berinhard @ewdurbin I have no idea the cause of this error. https://app.travis-ci.com/github/python/pythondotorg/builds/234219521#L1327-L1429 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luzfcb thanks again for opening such an important PR. I noticed that there are 3 tests failing but I didn't have the opportunity to run then locally to investigate the problem. As soon as I finish with other priorities, I'll investigate them. If you want to pair on them, I'll be happy to do so. I'm usually available during morning time.
@berinhard I updated the description, made some requested changes, and rebased with the main branch. Can review again? |
I created a separate pull-request for this issue #1839 |
7785b5d
to
9d8449b
Compare
|
||
{% elif URL_NAME %} | ||
{% sitetree_tree from URL_NAME template "sitetree/sidebar_menu_root.html" %} | ||
{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory, this makes the 3 tests start to pass
https://app.travis-ci.com/github/python/pythondotorg/builds/235762782#L1343-L1648
I'm not sure this is the correct way to fix this.
Anyway, thanks @lucianoratamero for helping me debug this error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I could understand, this context processor, for some reason, wasn't raising the Resolver404
exception for db-routes such as is happening with tests related to Page
or Release
objects.
I also checked the PageView
implementation to confirm if it wasn't doing something unexpected but I didn't see anything out of place.
I tested 2 type of dynamic pages to check what would break if the path wasn't configured correctly. If I access an URL (/lorem-ipsum/
) mapped to a Page
object with the URL not being listed under the sitetree, I can see the content but without the navigation links as you can see here:
If update this same object to have a path which is listed under the site tree, such as /about/gettingstarted/
, the user sees both the page content and the navigation links as expected. Here's the print screen:
So, I think this fix is a good one 👍
@berinhard @ewdurbin this pull request is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luzfcb the PR #1848 replaced travis by github actions and this is resulting in conflicts. Can you update .github/workflows/ci.yml
file instead?
@ewdurbin I tested it locally and everything seems to be good so far. But since you have a more "trained" pair of eyes on how the site should look like, it would be nice to have your review and also your comments on the still open discussions.
|
||
{% elif URL_NAME %} | ||
{% sitetree_tree from URL_NAME template "sitetree/sidebar_menu_root.html" %} | ||
{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I could understand, this context processor, for some reason, wasn't raising the Resolver404
exception for db-routes such as is happening with tests related to Page
or Release
objects.
I also checked the PageView
implementation to confirm if it wasn't doing something unexpected but I didn't see anything out of place.
I tested 2 type of dynamic pages to check what would break if the path wasn't configured correctly. If I access an URL (/lorem-ipsum/
) mapped to a Page
object with the URL not being listed under the sitetree, I can see the content but without the navigation links as you can see here:
If update this same object to have a path which is listed under the site tree, such as /about/gettingstarted/
, the user sees both the page content and the navigation links as expected. Here's the print screen:
So, I think this fix is a good one 👍
044928a
to
9928e1b
Compare
@berinhard I pushed a fix for PostgreSQL running in GitHub Actions |
@berinhard @ewdurbin this pull-request is ready for review and merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spun this up and smoke tested it with a copy of the prod db and all seems well! There's one migration in the sponsors app that needs to be updated and then we can ship it!
Update dependencies for django 2.2 compatibility
@ewdurbin I made the requested changes. It's ready for review. As it's the first time I've contributed to this project, Github Action workflow needs manual approval again to run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this effort!
Deploying now! I'll be keeping a close eye on the application through the rest of the day <3 |
Thanks so much @luzfcb! This has been rolling smoothly now for days! |
Fix #1819
env_sample
file with the environment variables that is available to use. If a file named.env
exists on the project root path, the python-decouple will read. Note: Environment variables have precedence over the python-decouple config files.apps.py
files for all modules that have migrations, template tags, or management commandspath()
orre_path()
instead ofurl()
gettext_lazy
instead ofugettext_lazy
filter_fields
tofilterset_fields
andfilter_class
tofilterset_class
to be compatible with the new version of django-filterW605 invalid escape sequence \
in events/tests/test_importer.py (related to https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior)url_name
function shadowing on pydotorg/context_processors.pyFORM_RENDERER = 'django.forms.renderers.DjangoTemplates'
topydotorg/settings/base.py
obj=None
argument onsponsors.admin.SponsorBenefitInline.has_add_permission
methodbase_name
tobasename
onpydotorg/urls_api.py
to be compatible with the new version of django-restframeworkadded_by_user
field ofSponsorBenefit
model that that Django <=2.0 cannot detect. This migration only includesblank=True
in the migration and does not touch the database, which means do NOT generate SQL.static
templatetag instead ofadmin_static
.static
templatetag instead ofstaticfiles
.NullBooleanField()
byBooleanField(null=True)
. Note: The migration will not generate an SQL. Django 2.1 release notes recommend this change but only in Django 3.1NullBooleanField
is effectively marked as deprecated.BytesIO
fromio
and not fromsix
)TODO:
Django 3.2 TODO:
Note: The code as it is in this pull-request is already capable of running the test suite with Django 3.2
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
topydotorg/settings/base.py
to avoid unwanted migrationsfrom django.contrib.postgres.fields import JSONField
byfrom django.db.models import JSONField
oncommunity/models.py
and deal with the migrations.default_app_config
variable from all__init__.py
files of all apps.--
Pull-request sponsored by
Need a team for your project? Let's talk