11<p align =" center " >
22 <img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
33</p >
4- <h1 align =" center " style =" margin : 30px 0 30px ; font-weight : bold ;" >Dash-FastAPI-Admin v1.1 .0</h1 >
4+ <h1 align =" center " style =" margin : 30px 0 30px ; font-weight : bold ;" >Dash-FastAPI-Admin v1.2 .0</h1 >
55<h4 align =" center " >基于Dash+FastAPI前后端分离的纯Python快速开发框架</h4 >
66<p align =" center " >
77 <a href="https://gitee.com/insistence2022/dash-fastapi-admin/stargazers"><img src="https://gitee.com/insistence2022/dash-fastapi-admin/badge/star.svg?theme=dark"></a>
88 <a href="https://github.com/insistence/Dash-FastAPI-Admin"><img src="https://img.shields.io/github/stars/insistence/Dash-FastAPI-Admin?style=social"></a>
9- <a href="https://gitee.com/insistence2022/dash-fastapi-admin"><img src="https://img.shields.io/badge/DashFastAPIAdmin-v1.1 .0-brightgreen.svg"></a>
9+ <a href="https://gitee.com/insistence2022/dash-fastapi-admin"><img src="https://img.shields.io/badge/DashFastAPIAdmin-v1.2 .0-brightgreen.svg"></a>
1010 <a href="https://gitee.com/insistence2022/dash-fastapi-admin/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
1111 <img src="https://img.shields.io/badge/python-3.8 | 3.9-blue">
1212 <img src="https://img.shields.io/badge/MySQL-≥5.7-blue">
@@ -97,7 +97,7 @@ Dash-FastAPI-Admin是一套全部开源的快速开发平台,毫无保留给
9797- * 密码:admin123*
9898- 演示地址:<a href =" https://dfadmin.insistence.tech " >dfadmin管理系统<a >
9999
100- ## 项目运行相关
100+ ## 项目开发及发布
101101
102102``` bash
103103# 克隆项目
@@ -110,30 +110,94 @@ cd dash-fastapi-admin
110110pip3 install -r requirements.txt
111111```
112112
113- ### 前端
113+ ### 开发
114+
115+ #### 前端
116+ ``` bash
117+ # 进入前端目录
118+ cd dash-fastapi-frontend
119+
120+ # 配置应用信息
121+ 在.env.dev文件中配置应用开发模式的相关信息
122+
123+ # 运行前端
124+ python3 app.py --env=dev
125+ ```
126+
127+ #### 后端
128+ ``` bash
129+ # 进入后端目录
130+ cd dash-fastapi-backend
131+
132+ # 配置环境
133+ 1.在.env.dev文件中配置开发模式的数据库环境
134+ 2.在.env.dev文件中配置开发模式的redis环境
135+
136+ # 运行sql文件
137+ 1.新建数据库dash-fastapi(默认,可修改)
138+ 2.使用命令或数据库连接工具运行sql文件夹下的dash-fastapi.sql
139+
140+ # 运行后端
141+ python3 app.py --env=dev
142+ ```
143+
144+ ### 发布
145+
146+ 本应用发布建议使用nginx部署,nginx代理配置参考如下:
147+
148+ ``` bash
149+ server {
150+ location / {
151+ proxy_set_header Host $http_host ;
152+ proxy_set_header X-Real-IP $remote_addr ;
153+ proxy_set_header REMOTE-HOST $remote_addr ;
154+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
155+ proxy_pass http://127.0.0.1:8088/;
156+ }
157+
158+ location /prod-api {
159+ proxy_set_header Host $http_host ;
160+ proxy_set_header X-Real-IP $remote_addr ;
161+ proxy_set_header REMOTE-HOST $remote_addr ;
162+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
163+ proxy_pass http://127.0.0.1:9099/;
164+ rewrite ^/prod-api/(.* )$ /$1 break ;
165+ }
166+
167+ error_page 500 502 503 504 /50x.html;
168+ location = /50x.html {
169+ root html;
170+ }
171+ }
172+ ```
173+
174+ #### 前端
114175``` bash
115176# 进入前端目录
116177cd dash-fastapi-frontend
117178
179+ # 配置应用信息
180+ 在.env.prod文件中配置应用发布的相关信息,注意:APP_BASE_URL需要配置为nginx代理的地址,例如上面的nginx代理监听的是8000端口,则APP_BASE_URL需要配置为http://127.0.0.1:8000
181+
118182# 运行前端
119- python3 wsgi.py
183+ python3 wsgi.py --env=prod
120184```
121185
122- ### 后端
186+ #### 后端
123187``` bash
124188# 进入后端目录
125189cd dash-fastapi-backend
126190
127191# 配置环境
128- 1.在config/ env.py的DataBaseConfig类中配置数据库环境
129- 2.在config/ env.py的RedisConfig类中配置redis环境
192+ 1.在. env.prod文件中配置生产模式的数据库环境
193+ 2.在. env.prod文件中配置生产模式的redis环境
130194
131195# 运行sql文件
1321961.新建数据库dash-fastapi(默认,可修改)
1331972.使用命令或数据库连接工具运行sql文件夹下的dash-fastapi.sql
134198
135199# 运行后端
136- python3 app.py
200+ python3 app.py --env=prod
137201```
138202
139203### 访问
0 commit comments