-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
replace django.core.urlresolvers with django.urls to appeace Django2.… #106
Conversation
defender/tests.py
Outdated
@@ -13,7 +13,7 @@ | |||
from django.contrib.auth.models import User | |||
from django.contrib.auth.models import AnonymousUser | |||
from django.contrib.sessions.backends.db import SessionStore | |||
from django.core.urlresolvers import reverse | |||
from django.urls import reverse |
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 seems to be failing when run against old versions of django. Maybe we can do the following.
try:
django.urls import reverse
except ImportError:
django.core.urlresolvers import reverse
It tries to do it the new way, if it fails it falls back to the old way.
defender/views.py
Outdated
@@ -1,6 +1,6 @@ | |||
from django.shortcuts import render | |||
from django.http import HttpResponseRedirect | |||
from django.core.urlresolvers import reverse | |||
from django.urls import reverse |
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.
Same comment as above.
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 the PR, the changes are breaking some of the tests on older versions of django. If we can add the try except block as I described this should be able to make it backwards compatible.
I also noticed a similar change in #105 except your PR includes the tests.py as well. |
@kencochrane Thank you very much for the comments! I also looked at the other PR you mentioned and added the updated install_requirements to my PR |
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, thank you!
I see that change requests are not the same for everyone ;) Testing against Django 2.0 has not been added here (see #105) |
@btoueg this PR was made after yours. Your PR already had those changes. I made the mistake and assumed your PR would be merged first and didn’t want to have duplicate code in more than one PR, to limit merge conflicts. Sorry for the trouble. |
…0 deprecations