Opened 7 years ago

Closed 7 years ago

#28924 closed Bug (invalid)

path function in Django 2.0 does not seem to work with django-rest-framework's format_suffix_patterns function

Reported by: Aakash Jha Owned by: nobody
Component: Core (URLs) Version: 2.0
Severity: Normal Keywords: path
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The newly introduced path() function in django.urls does not work with format_suffix_patterns() function of rest_framework.urlpatterns.

As mentioned in http://www.django-rest-framework.org/tutorial/2-requests-and-responses/ , in order to receive a response from the api server in the desired format, a .json or .api might be appended with the url. This does not seem to work when the urlpattern[] has its urls mentioned in the new path() function.

When I switched back to using url() in urlpatterns[], the issue was resolved.

Change History (2)

comment:1 by Aakash Jha, 7 years ago

Summary: path function in Django 2.0 does not seem to work with django-rest-framework's format_suffix_patterns function that is used to refer to a specific response formatpath function in Django 2.0 does not seem to work with django-rest-framework's format_suffix_patterns function

comment:2 by Simon Charette, 7 years ago

Resolution: invalid
Status: newclosed

Given no reason was provided about what Django's path is doing wrong I believe this something that should be fixed on the DRF side.

Please re-open if you can provide more details about what Django is doing wrong as simply reporting that a third party feature is not working as documented when used with a newly introduced Django feature strongly indicates that the third party, DRF in this case, simply didn't add proper support for path yet.

Note: See TracTickets for help on using tickets.
Back to Top