Skip to content

replaced url() with re_path() in Versioning docs #7043

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

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

brantmorton
Copy link
Contributor

Note: Before submitting this pull request, please review our contributing guidelines.

Description

Fixes #6885:

  • replaces instances of url() with re_path() in URLPathVersioning and NamespaceVersioning in the Versioning Docs

@auvipy
Copy link
Member

auvipy commented Nov 7, 2019

why not path?

@brantmorton
Copy link
Contributor Author

The idea of using re_path() instead of path() was simply to maintain the same url patterns that we had when using url().

Do you think we should make it path()?

@xordoquy
Copy link
Collaborator

xordoquy commented Nov 7, 2019

I am not sure expression such as (?P<version>(v1|v2)) can be converted to path.
Others look like they could be expressed as path

@brantmorton
Copy link
Contributor Author

brantmorton commented Nov 7, 2019

I agree, I cannot think of a way. I've been trying to find a workaround, but I'm not sure that there would be a direct translation.

path would be more readable, but it may be confusing if the examples are not uniform.

Copy link
Collaborator

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

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

Yep, this is great thanks!

(path() nice as it is isn't the one blessed way. We don't have to eliminate all regex routes — in fact, it's probably good to have a mix of examples.)

@carltongibson carltongibson merged commit 0d6589c into encode:master Nov 7, 2019
@brantmorton brantmorton deleted the update-versioning-docs branch November 7, 2019 12:26
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
sigvef pushed a commit to sigvef/django-rest-framework that referenced this pull request Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Versioning docs kind of outdated
4 participants