环境配置及 README.md 说明文档

pull/1/head
李强 2021-02-26 19:57:14 +08:00
parent 09ae136a1f
commit 5e22ac37f5
8 changed files with 37 additions and 35 deletions

View File

@ -1,11 +1,20 @@
# Django-Vue-Admin
使用django+vue进行极速开发的全栈管理系统。
[![img](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitee.com/liqianglog/django-vue-admin/blob/master/LICENSE) [![img](https://img.shields.io/pypi/v/django-simpleui.svg)](https://pypi.org/project/django-simpleui/#history) [![img](https://img.shields.io/badge/python-%3E=3.6.x-green.svg)](https://python.org/) ![PyPI - Django Version badge](https://img.shields.io/badge/django%20versions-2.2-blue)[![img](https://img.shields.io/pypi/dm/django-simpleui.svg)](https://pypi.org/project/django-simpleui/)
## 平台简介
Django-Vue-Admin 是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
* 前端采用ruoyi-ui 、Vue、Element UI。
* 后端采用Python语言Django框架。
* 权限认证使用Jwt支持多终端认证系统。
* 支持加载动态权限菜单,多方式轻松权限控制。
* ~~高效率开发,使用代码生成器可以一键生成前后端代码。~~
* 特别鸣谢:[RuoYi](https://gitee.com/y_project/RuoYi-Vue) [Vue-Element-Admin](https://github.com/PanJiaChen/vue-element-admin)[eladmin-web](https://gitee.com/elunez/eladmin-web?_from=gitee_search)[Gin-Vue-Admin](https://www.gin-vue-admin.com/)。
## QQ群
- QQ群号812482043
@ -20,15 +29,6 @@ github地址[https://gitee.com/liqianglog/django-vue-admin](https://gitee.com
gitee地址[https://github.com/liqianglog/django-vue-admin](https://github.com/liqianglog/django-vue-admin)
## 平台简介
* 前端采用ruoyi-ui 、Vue、Element UI。
* 后端采用Python语言Django框架。
* 权限认证使用Jwt支持多终端认证系统。
* 支持加载动态权限菜单,多方式轻松权限控制。
* ~~高效率开发,使用代码生成器可以一键生成前后端代码。~~
* 特别鸣谢:[RuoYi](https://gitee.com/y_project/RuoYi-Vue) [Vue-Element-Admin](https://github.com/PanJiaChen/vue-element-admin)[eladmin-web](https://gitee.com/elunez/eladmin-web?_from=gitee_search)[Gin-Vue-Admin](https://www.gin-vue-admin.com/)。
## 内置功能
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
@ -73,6 +73,7 @@ npm install --registry=https://registry.npm.taobao.org
npm run dev
# 浏览器访问 http://localhost:8080
# .env.development 文件中可配置启动端口等参数
```
### 发布
@ -87,6 +88,19 @@ npm run build:prod
## 后端
~~~bash
1. 进入项目目录 cd dvadmin-backend
2. 在项目根目录中,复制 env.example.py 文件为一份新的,并重命名为 env.py
3. 在 env.py 中配置数据库信息
4. 执行迁移命令:
python3 manage.py makemigrations
python3 manage.py migrate
5. 创建 admin 用户
python3 manage.py createsuperuser
6. 启动项目
python3 manage.py runserver 0.0.0.0:8000
~~~

View File

@ -89,7 +89,7 @@ ENV/
*.db
.DS_Store
__pycache__
migrations/
!migrations/__init__.py
*.pyc
config.py
!conf/env.example.py
db.sqlite3

View File

@ -16,7 +16,7 @@ import os
from mongoengine import connect
from environment import *
from conf.env import *
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -278,6 +278,8 @@ AUTHENTICATION_BACKENDS = (
'utils.backends.SessionAuthentication',
)
AUTH_USER_MODEL = 'permission.UserProfile'
# username_field
USERNAME_FIELD = 'username'
# ================================================= #
# ************** 登录验证码配置 ************** #

View File

@ -1,10 +1,4 @@
"""
本地开发配置
# 配置使用说明
- 首先在backend下面新建config.py
eg:
environment_config = 'env'
"""
# ================================================= #
# ************** mysql数据库 配置 ************** #
# ================================================= #
@ -17,7 +11,7 @@ DATABASE_PORT = 3306
# 数据库用户名
DATABASE_USER = "root"
# 数据库密码
DATABASE_PASSWORD = "Aa428912."
DATABASE_PASSWORD = "123456"
# 数据库名
DATABASE_NAME = "django-vue-admin"
@ -34,7 +28,7 @@ MONGO_PORT = 27017
REDIS_DB = 1
REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379
REDIS_PASSWORD = 'q1w2e3r4T%Y^U&I*2020'
REDIS_PASSWORD = '123456'
# ================================================= #
# ************** 默认配置 ************** #
@ -45,7 +39,5 @@ ALLOWED_HOSTS = ['*']
CORS_ORIGIN_ALLOW_ALL = True
# 允许ajax请求携带cookie
CORS_ALLOW_CREDENTIALS = False
# username_field
USERNAME_FIELD = 'username'
# 验证码状态
CAPTCHA_STATE = True

View File

@ -1,10 +0,0 @@
from config import environment_config
if environment_config == 'sit':
from conf.sit import *
elif environment_config == 'prod':
from conf.prod import *
else :
from conf.env import *
print(f"导入[{environment_config}]配置成功!")

View File

@ -6,5 +6,9 @@ VUE_APP_BASE_API = 'http://127.0.0.1:8000'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 前端端口
PORT=8080
# 首页标题
TITLE = 'dvAdmin管理系统'