分类目录归档:django-rest-framework

django rest framework


1.安装

pip install djangorestframework
pip install markdown       # Markdown support for the browsable API.
pip install django-filter  # Filtering support
  • 修改settings 文件的INSTALLED_APPS
INSTALLED_APPS = [
    ...
    'rest_framework',
]
  • 添加路由
    urlpatterns = [
      ...
      url(r'^api-auth/',

Read more