摘要: 1.安装 pip install django-rest-swagger 2.配置 rest_api/settings.py INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.conte 阅读全文
posted @ 2020-03-30 18:40 侃豺小哥 阅读(1920) 评论(0) 推荐(0) 编辑
摘要: 1.django中的log需要在settings.py中配置 import time cur_path = os.path.dirname(os.path.realpath(__file__)) # log_path是存放日志的路径 log_path = os.path.join(os.path.d 阅读全文
posted @ 2020-03-30 18:32 侃豺小哥 阅读(1323) 评论(0) 推荐(0) 编辑
摘要: 1.安装django-cors-headers pip install django-cors-headers 2.配置settings.py文件 INSTALLED_APPS = [ ... 'corsheaders', ... ] # 添加中间件MIDDLEWARE = [ 'django.mi 阅读全文
posted @ 2020-03-30 18:26 侃豺小哥 阅读(326) 评论(0) 推荐(0) 编辑