django-rest-framework

2022/4/13 23:15:23

本文主要是介绍django-rest-framework,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

网址:

https://www.django-rest-framework.org/

支持:

  • Python (3.6, 3.7, 3.8, 3.9, 3.10)
  • Django (2.2, 3.0, 3.1, 3.2, 4.0)

安装:

  •   pip install djangorestframework
  •   pip install markdown # Markdown support for the browsable API.
  •   pip install django-filter # Filtering support
  •   或 git clone https://github.com/encode/django-rest-framework

注册:

  Add 'rest_framework' to your INSTALLED_APPS setting.

  INSTALLED_APPS = [
   ...
   'rest_framework',
  ]

url:

urlpatterns = [
...
path('api-auth/', include('rest_framework.urls'))
]

权限:

 



这篇关于django-rest-framework的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程