drf-chunked-upload
drf-chunked-upload copied to clipboard
No Reverse Match for `chunkedupload-detail`
Using the basic setup:
from drf_chunked_upload.views import ChunkedUploadView
class MyChunkView(ChunkedUploadView):
pass
I'm hitting a NoReverseMatch
error. This seems to be cause on the serializer.py
where it tries to to find a chunkedupload-detail
URL and doesn't seem to find the one in tests.py
(assuming this is the reverse target). I've had to get around it just creating my own url and view e.g.
urls.py
path(
"uploadchuncks/<uuid:pk>/",
ChunkedUploadDetailView.as_view(),
name="chunkedupload-detail",
),
views.py
class ChunkedUploadDetailView(RetrieveAPIView):
queryset = ChunkedUpload.objects.all()
serializer_class = ChunkedUploadSerializer
Curious if anyone else is experiencing this?
Packages:
Django==3.2.16
Any updates? I am trying the package with a basic setup like you. But got the same error. Could you find any solution?
That is correct, you need a URL with the name chunkedupload-detail
to not get the NoReverseMatch
exception. The path should actually map to the same MyChunkView
in your example, and you shoudn't need to create your own based off of RetrieveAPIView
. See here for an example: https://github.com/shipperstack/shipper/blob/master/server/api/urls.py and https://github.com/shipperstack/shipper/blob/master/server/api/views/shippy.py
Any updates? I am trying the package with a basic setup like you. But got the same error. Could you find any solution?
The only solution I had was to have a separate path e.g.
path(
"uploadchuncks/<uuid:pk>/",
ChunkedUploadDetailView.as_view(),
name="chunkedupload-detail",
)
The reason it could be not picking it up is because Django is only looking for paths in your project (i.e. not third party packages) so perhaps a solution for this project is to export the tests.py
urls (e.g. https://github.com/jkeifer/drf-chunked-upload/blob/main/tests/urls.py) to allow it to be appended onto your urlpatterns
in your base urls.py
?