django-rest-framework-mongoengine-example icon indicating copy to clipboard operation
django-rest-framework-mongoengine-example copied to clipboard

Adding custom api view with HybridRouter fails to list properly in APIRoot view

Open Isshwarya opened this issue 2 years ago • 0 comments

https://github.com/BurkovBA/django-rest-framework-mongoengine-example/blob/dcae174fe19f785d7c629b9eca450da3fe7e6e2b/project/project/routers.py#L79

This line should be

 try:
                        ret[api_view_key] = reverse(
                            api_view_key,  ============> line fixed, this cannot be url_name as thats a variable from the previous for loop.
                            args=args,
                            kwargs=kwargs,
                            request=request,
                            format=kwargs.get('format', None)
                        )

Isshwarya avatar Mar 21 '22 08:03 Isshwarya