mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Add url_path documention for detail_route decorator
This commit is contained in:
parent
2448cc8e85
commit
a8a3fedb5c
|
@ -53,6 +53,8 @@ Notice that we've also used the `@detail_route` decorator to create a custom act
|
|||
|
||||
Custom actions which use the `@detail_route` decorator will respond to `GET` requests. We can use the `methods` argument if we wanted an action that responded to `POST` requests.
|
||||
|
||||
The URLs for custom actions by default depends on the method name itself. If you want to change the way url should be constructed, you can use `url_path` parameter of `@detail_route` and provide the string value for the same.
|
||||
|
||||
## Binding ViewSets to URLs explicitly
|
||||
|
||||
The handler methods only get bound to the actions when we define the URLConf.
|
||||
|
|
Loading…
Reference in New Issue
Block a user