5

I'm trying to run longclaw, but i get an error

$ python manage.py makemigrations catalog home

Traceback (most recent call last):
[...]
 File "/lib/python3.7/site-packages/longclaw/basket/api.py", line 1, in <module>
   from rest_framework.decorators import detail_route, list_route
ImportError: cannot import name 'detail_route' from 'rest_framework.decorators'
milahu
  • 2,447
  • 1
  • 18
  • 25
netro netroo
  • 53
  • 1
  • 3

1 Answers1

22

Its because detail_route has been deprecated from DRF 3.8. You can check their change-log as well. Alternatively, you can use actions decorator. For example:

from rest_framework.decorators import action

@action(detail=True, methods=['post'])
def set_password(self, request, pk=None):
   ....
ruddra
  • 50,746
  • 7
  • 78
  • 101