Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
Update browsable-api.md#9509
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Deprecated url(), use re_path(). Show imports.
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")) |
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 doesn't need to be a regex,path("api-auth/")...
is just fine.
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.
Little note about why i suggested re_path and not path (searching stackoverflow):
re_path() is similar tourl() (both have regex support).
path() doesn't. (See Django docs)
But you are right, most of the docs usepath()
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.
Added a small note about unnecessary regex.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
f593f57
intoencode:masterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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 ourcontributing guidelines.
Description
Documentation edited: deprecated method correction.