10 2020 档案

摘要:1 前后端跨域 1.1 前端 1.1.1 方法一 1)index.js import axios from 'axios' axios.defaults.baseURL="http://192.168.56.100:8000/" axios.defaults.timeout = 1000000; a 阅读全文
posted @ 2020-10-29 21:46 狐狸大大爱吃糖 阅读(212) 评论(0) 推荐(0)
摘要:1 创建表 1.1 Meta 源信息 from django.db import models class UserInfo(models.Model): username = models.CharField(max_length=32) password = models.CharField(m 阅读全文
posted @ 2020-10-28 20:45 狐狸大大爱吃糖 阅读(269) 评论(0) 推荐(0)
摘要:前言: ModelViewSet 是对APIView封装 ModelSerializer是对Serializer的封装 1 APIview使用 1.1 在 user/urls.py 中添加路由 urlpatterns = [ path('apiview/', views.UserInfoViewSe 阅读全文
posted @ 2020-10-28 20:20 狐狸大大爱吃糖 阅读(232) 评论(0) 推荐(0)
摘要:1 Django路径 1.1 路径问题引入 import sys 当前文件夹优先搜索(同名会覆盖) BASE_DIR 指的是django项目根路径 print(os.path.abspath(__file__)) # 当前文件绝对路径 # /root/shiyanlou_project/syl/sy 阅读全文
posted @ 2020-10-27 21:17 狐狸大大爱吃糖 阅读(610) 评论(0) 推荐(1)
摘要:1 初始化项目结构 └─shiyanlou_project # 项目根路径 │ .gitignore # 提交git仓库时,不提交的文件必须要在这里进行标注 │ README.en.md # 英文(项目介绍) │ README.md # 中文项目简介 │ requirements.txt # dja 阅读全文
posted @ 2020-10-26 21:11 狐狸大大爱吃糖 阅读(538) 评论(0) 推荐(0)
摘要:1 web项目工作流程 1.1 了解web程序工作流程 1.2 django生命周期 HTTP uwsgi uwsgi WSGI浏览器 > Nginx > uWSGI > PythonWSGImodule > Python application (web服务器)(web服务器)(web服务器) ( 阅读全文
posted @ 2020-10-26 18:38 狐狸大大爱吃糖 阅读(319) 评论(0) 推荐(0)