快速开始

本地运行后端项目

视频教程open in new window

下载项目

git clone https://gitee.com/mldong666/mldong-python.git

进入目录

cd mldong-python

创建虚拟环境

python -m venv ./venv

激活虚拟环境

source venv/Scripts/activate

安装依赖

pip3 install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

创建数据库

依次执行

  • doc/sql/mldong-plus1.0.sql ===>系统管理+工作流程模块
  • doc/sql/dev.sql ===>在线开发,元数据管理模块
  • doc/sql/biz_demo.sql===>演示模块

配置数据库

修改config.py文件或者添加环境变量

  • DB_HOST 数据库ip
  • DB_PORT 数据库端口
  • DB_NAME 数据库名称
  • DB_USER 数据库用户
  • DB_PASSWORD 数据库密码

配置redis

  • REDIS_HOST redis ip
  • REDIS_PORT redis端口
  • REDIS_PASSWORD redis密码

设置环境变量

export FLASK_APP=app.py
export FLASK_ENV=development
export FLASK_DEBUG=1
export FLASK_RUN_PORT=18080

注:如果FLASK_RUN_PORT=18080,则下面前端的VITE_PROXY可以不用调整。

运行

flask run

其他命令

代码生成

flask code gen -t sys_role -ignore_prefix=sys_

生成依赖文件

pip3 freeze > requirements.txt

本地运行前端项目

视频教程open in new window

下载项目

git clone https://gitee.com/mldong/mldong-vue.git

安装依赖

# 全局安装yarn
npm install -g yarn --registry=https://registry.npmmirror.com/
# 忽略引擎检测
yarn config set ignore-engines true

yarn install --registry=https://registry.npmmirror.com/
# 如果报gifsicle-5.3.0.tgz: Integrity check failed for "gifsicle"错,则执行
yarn install --update-checksums

配置后端地址

修改.env.development文件

VITE_PROXY=[["/api","http://localhost:18080"]]

修改为

VITE_PROXY=[["/api","http://localhost:5000"]]

运行

yarn dev

访问前端

http://localhost:3100/open in new window