django restframework 环境配置
2024-10-19 06:27:06
Requirements:
coreapi (1.32.0+) - Schema generation support.
Markdown (2.1.0+) - Markdown support for the browsable API.
django-filter (1.0.1+) - Filtering support.
django-crispy-forms - Improved HTML display for filtering.
django-guardian (1.1.1+) - Object level permissions support.
$ pip3 install coreapi markdown django-filter django-crispy-forms django-guardian djangorestframework
settings.py
INSTALLED_APPS = (
...
'rest_framework',
)
urls.py
from django.urls import path,include
from rest_framework.documentation import include_docs_urls urlpatterns = [
...
# 接口文档说明
path(r'docs/',include_docs_urls(title="kcdb")),
# rest_framework自带登录
path(r'api-auth/', include('rest_framework.urls', namespace='rest_framework')),
]
最新文章
- Collection小结
- 你所不知道的JavaScript数组
- 后端码农谈前端(CSS篇)第六课:盒子模型
- Linux中sudo配置
- Openfire 的安装和配置
- Jewelry Exhibition(最小点覆盖集)
- Ubuntu 学习笔记
- CentOS6.5安装LAMP环境APACHE的安装
- spring项目中监听器作用-ContextLoaderListener(项目启动时,加载一些东西到缓存中)
- java内部类实现多继承
- [Immutable.js] Differences between the Immutable.js Map() and List()
- Lintcode389 Valid Sudoku solution 题解
- Lucene.Net3.0.3+盘古分词器学习使用
- .pyc是个什么 python的执行过程
- 用java写图片
- flume组件汇总 source、sink、channel
- 深入理解 JS 引擎执行机制(同步执行、异步执行以及同步中的异步执行)
- CF868 F. Yet Another Minimization Problem 决策单调优化 分治
- jQuery 复选框全选/取消全选/反选
- 解决阿里云OSS跨域问题