Merged
Conversation
Deprecated url(), use re_path(). Show imports.
ulgens
reviewed
Aug 22, 2024
docs/topics/browsable-api.md
Outdated
| urlpatterns = [ | ||
| # ... | ||
| url(r"^api-auth/", include("rest_framework.urls", namespace="rest_framework")) | ||
| re_path(r"^api-auth/", include("rest_framework.urls", namespace="rest_framework")) |
Contributor
There was a problem hiding this comment.
This doesn't need to be a regex, path("api-auth/")... is just fine.
Contributor
Author
There was a problem hiding this comment.
Little note about why i suggested re_path and not path (searching stackoverflow):
re_path() is similar to url() (both have regex support).
path() doesn't. (See Django docs)
But you are right, most of the docs use path()
ulgens
suggested changes
Aug 22, 2024
Contributor
ulgens
left a comment
There was a problem hiding this comment.
Added a small note about unnecessary regex.
auvipy
requested changes
Aug 27, 2024
auvipy
approved these changes
Aug 27, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The documentation uses a deprecated method url(), use re_path() instead. Explicit imports (which were not specified).
Note: Before submitting a code change, please review our contributing guidelines.
Description
Documentation edited: deprecated method correction.