LoginSignup
1
0

More than 3 years have passed since last update.

Django rest framework decorators `action decorator replaces list_route and detail_route`

Last updated at Posted at 2020-02-18

背景

Django1.11.1のサポートが4月とかで切れるので、Django2.2にupdateを行っている。
Djangoのアップデートに伴って、restframeworkのバージョンも 3.6.3 から 3.8.2 にアップ。
するとPyCharmのapi.pyにこんな横棒が。

from rest_framework.decorators import detail_route, list_route

しかしroutingは正常に行えている。

確認

以下のページでアナウンスされていた。
https://www.django-rest-framework.org/community/3.8-announcement/

Both list_route and detail_route are now pending deprecation. 
They will be deprecated in 3.9 and removed entirely in 3.10.

なるほど、バージョン3.8.2ではまだ完全には廃止されていない。

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0