-
Notifications
You must be signed in to change notification settings - Fork 1
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
Task/sapnamysore/tlt 3253/upgrade django #44
Task/sapnamysore/tlt 3253/upgrade django #44
Conversation
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.
Looks good! Just a few changes and minor suggestions.
Django==1.9.12 | ||
cx-Oracle==5.2.1 | ||
Django==1.11.9 | ||
cx-Oracle==6.0.3 |
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.
Latest version of cx_Oracle is now 6.1 I believe
git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-auth-lti==1.2.9 | ||
|
||
# NOTE: Including the django-pgjson library here. This is required by 'async' within django-icommons-common, but | ||
# there is fix for a bug for django<=1.10 , thgat is still in a commit but is not in the released version. Unable to specify |
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.
Minor spelling error for that
canvas_manage_course/views.py
Outdated
url = "%s://%s%s" % (request.scheme, request.get_host(), | ||
reverse('lti_launch', exclude_resource_link_id=True)) | ||
|
||
if request.is_secure(): |
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.
FWIW, for our hosted apps, this will always be true since we have a redirect in nginx from http to https.
canvas_manage_course/views.py
Outdated
else: | ||
host = 'http://' + request.get_host() | ||
|
||
url = host + reverse('lti_launch') |
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.
I would think that we'd always want our tool launch urls (this one, at least) to be over ssl. IIRC, Canvas prefers/demands that LTI tools be running over secure connections - maybe it's actually browsers that enforce that due to mixed content warnings/errors. In any case, I'd be tempted to simply make the url https
here.
canvas_manage_course/urls.py
Outdated
@@ -15,3 +16,9 @@ | |||
url(r'^not_authorized$', icommons_ui_views.not_authorized, name='not_authorized'), | |||
url(r'^tool_config$', views.tool_config, name='tool_config'), | |||
] | |||
|
|||
if settings.DEBUG: | |||
import debug_toolbar |
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.
Can we add put this in a try/except block? We normally don't require the toolbar in our aws environments, although we might want to run in DEBUG
mode on a non-prod deployed instance.
Django==1.9.12 | ||
cx-Oracle==5.2.1 | ||
Django==1.11.9 | ||
cx-Oracle==6.0.3 | ||
django-cached-authentication-middleware==0.2.1 | ||
django-redis-cache==1.7.1 | ||
hiredis==0.2.0 | ||
kitchen==1.2.4 | ||
ndg-httpsclient==0.4.2 |
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.
Would you mind removing the ndg-httpsclient
library? We don't need it on Xenial.
# NOTE: Including the django-pgjson library here. This is required by 'async' within django-icommons-common, but | ||
# there is fix for a bug for django<=1.10 , thgat is still in a commit but is not in the released version. Unable to specify | ||
# a commit in the django-icommons-common's setup.py, hence including it in the consuming app till we used switch from pjson to standard json | ||
git+ssh://[email protected]/djangonauts/django-pgjson.git@30463d210a42b2de#egg=django-pgjson |
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.
This version of pgjson uses import_by_path which is deprecated in Django 1.10+. Causes the deploy to fail.
djangonauts/django-pgjson@30463d210a42b2de#diff-09ac573aadd5de6bf33fc0a97964399a
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.
@Chris-Thornton-Harvard : So the latest Release (tagged 0.31) of django-pgjson from July 2015 ((https://github.com/djangonauts/django-pgjson/releases/tag/0.3.1) uses the deprecated import_by_path. The second link you have is the reported issue, but is still open.
I found the link to this particular commit - which a workaround to this issue(Details in the last comment here djangonauts/django-pgjson#43 ), it has been merged to master but not ben tagged. It worked locally for me, will check why it's failing while we deploy to dev. Thanks for catching it.
@bermudezjd : Made some changes based on the PR feedback. |
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.
Few minor nitpicks which would be nice to address, but looks good enough to merge.
canvas_manage_course/views.py
Outdated
reverse('lti_launch', exclude_resource_link_id=True)) | ||
|
||
host = 'https://' + request.get_host() | ||
url = host + reverse('lti_launch') |
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.
This works, although using string formatting reads better to me because I can more easily visualize the resulting string. That said, it's equivalent to the concats in place so no pressure to change:
url = "https://{0}{1}".format(request.get_host(), reverse('lti_launch'))
canvas_manage_course/urls.py
Outdated
@@ -15,3 +16,13 @@ | |||
url(r'^not_authorized$', icommons_ui_views.not_authorized, name='not_authorized'), | |||
url(r'^tool_config$', views.tool_config, name='tool_config'), | |||
] | |||
|
|||
try: |
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.
Can you move the try
block under the if
?
canvas_manage_course/urls.py
Outdated
url(r'^__debug__/', include(debug_toolbar.urls)), | ||
] | ||
except: | ||
pass |
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.
Might be good to have a small comment here so we can remember why we don't care about handling this exception in case we revisit the file.
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.
👍
Depends on https://github.com/Harvard-University-iCommons/django-canvas-lti-school-permissions/pull/11
Note: Do not merge till we have done some testing for a bit