-
Notifications
You must be signed in to change notification settings - Fork 184
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
Support Django 2.0 #177
Open
jasperlittle
wants to merge
11
commits into
manosim:master
Choose a base branch
from
jasperlittle:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Support Django 2.0 #177
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
aa28f4f
Implemented support for Django 2.0
jasperlittle e5656c1
Support older versions of drf
jasperlittle 1750d95
Improved dependency testing with tox
jasperlittle 807af1f
Updated setup and README to reflect supported versions
jasperlittle 4a35ce5
Updated requirements
jasperlittle 0375ec4
Remove mistake from tox.ini
jasperlittle 02b5621
Moved further details to compat
jasperlittle 075dc6d
Updated travis config
jasperlittle 72bc546
Further travis fixes
jasperlittle 2c1a8a9
Update package version
iesteban f49afb9
Merge pull request #1 from iesteban/master
jasperlittle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Django==1.8.7 | ||
djangorestframework==3.3.2 | ||
coverage==4.0.3 | ||
Django==1.11 | ||
djangorestframework==3.7.7 | ||
coverage==4.4.2 | ||
flake8==2.5.1 | ||
mkdocs==0.15.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.0.11' | ||
__version__ = '0.0.12b' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
try: | ||
from django.urls import ( | ||
URLPattern, | ||
URLResolver, | ||
) | ||
except ImportError: | ||
# Will be removed in Django 2.0 | ||
from django.urls import ( | ||
RegexURLPattern as URLPattern, | ||
RegexURLResolver as URLResolver, | ||
) | ||
|
||
|
||
# This is from the similarly named compat.py file of django-rest-framework 3.7 | ||
def get_regex_pattern(urlpattern): | ||
""" | ||
Get the raw regex out of the urlpattern's RegexPattern or RoutePattern. | ||
This is always a regular expression, unlike get_original_route above. | ||
""" | ||
if hasattr(urlpattern, 'pattern'): | ||
# Django 2.0 | ||
return urlpattern.pattern.regex.pattern | ||
else: | ||
# Django < 2.0 | ||
return urlpattern.regex.pattern | ||
|
||
|
||
def is_url_resolver(instance): | ||
return isinstance(instance, URLResolver) | ||
|
||
|
||
def is_url_pattern(instance): | ||
return isinstance(instance, URLPattern) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[tox] | ||
envlist = | ||
py{27,34,36}-django{1.10,1.11}-drf{3.4,3.5,3.6,3.7} | ||
py{34,36}-django2.0-drf3.7 | ||
|
||
[testenv] | ||
deps = | ||
py{27,34,36}: coverage == 4.4.2 | ||
flake8 == 2.5.1 | ||
django1.10: Django>=1.10,<1.11 | ||
django1.11: Django>=1.11,<1.12 | ||
django2.0: Django>=2.0,<2.1 | ||
drf3.4: djangorestframework>=3.4,<3.5 | ||
drf3.5: djangorestframework>=3.5,<3.6 | ||
drf3.6: djangorestframework>=3.6,<3.7 | ||
drf3.7: djangorestframework>=3.7,<3.8 | ||
commands = | ||
python runtests.py |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think this will cause 1.11.0 to be installed, not any 1.11.*