一、Vue3安装配置
1.Node 安装 略
2.安装cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
3.安装vue
cnpm install -g @vue/cli
4.创建项目
vue create bigdata_mobile #bigdata项目下
5.打包页面
npm run build #bigdata_mobile目录下
6.配置vue.config.js
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
assetsDir: 'static', #指定输出路径
})
二、Django 配置
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['bigdata_mobile/dist'], #inde.html 路径
'APP_DIRS': True,
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'bigdata_mobile/dist/static'),
]