Skip to content

Support URLPattern and URLResolver from Django 2.0 - #5500

Merged
carltongibson merged 2 commits into
encode:masterfrom
mkuznets:django2.0-urls
Oct 16, 2017
Merged

carltongibson merged 2 commits into
encode:masterfrom
mkuznets:django2.0-urls

Conversation

@mkuznets

Copy link
Copy Markdown
Contributor

Description

Fixes #5456

My attempt to make sense of the new URL routing API from Django 2.0:

  • RegexURLPattern and RegexURLResolver are renamed to URLPattern and URLResolver respectively.
  • Their regexes are now encapsulated inside RegexPattern/RoutePattern instances and are located at self.pattern.regex (was self.regex).
  • Both url() and the new path() return URLPattern. So, no changes needed to support the new routing syntax.

@carltongibson carltongibson added this to the 3.7.1 Release milestone Oct 16, 2017

@carltongibson carltongibson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkuznets Great stuff. Really clears up the test suite a lot!

Thanks for the input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants