本文介绍: 2、创建vue项目,执行npm init vue@latest,可参考 https://cn.vuejs.org/guide/quick–start.html#creating-a-vue–application。3、下载element–plus,npm install element–plus —save。3、请求http://ip:port/#/test,启动前端服务是会显示ip:port。1、下载安装node.js,下载地址 https://nodejs.org/en。
Django环境准备
1、下载django,执行命令 pip install django
2、新建django项目,执行命令 django–admin startproject mytest(项目名称),以上命令会在当前目录下创建一个名为mytest的Django项目
3、运行django项目,执行命令 python manage.py runserver
4、下载ninja,执行命令pip install django-ninja
Django跨域配置
1、执行命令 pip install django–cors–headers
2、在settings.py中
(1)INSTALLED_APPS里添加“corsheaders”
(2)MIDDLEWARE里添加‘corsheaders.middleware.CorsMiddleware‘
(3)增加CORS_ORIGIN_ALLOW_ALL=True
Vue环境准备
1、下载安装node.js,下载地址 https://nodejs.org/en
2、创建vue项目,执行npm init vue@latest,可参考 https://cn.vuejs.org/guide/quick–start.html#creating-a-vue–application
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。