Fetch the repository succeeded.
This action will force synchronization from 王星元/Wtp_test, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
test-user test-user1 test-user2 test-user3 test-user4
test-user5 test-user6 test-user7 test-user8 test-user9
test-user10
密码:12345678
项目前端使用开源框架构建 vue-element-admin
前端项目地址
1、 配置环境、安装依赖
pip install -r requirements.txt
2、 创建配置文件
根据运行环境的不同,自动选择配置文件
conf.dev.json # 开发环境
conf.prod.json # 生产环境
{
"storage": {
"mysql": {
"host": "xxx",
"port": 3306,
"user": "xxx",
"password": "xxx",
"database": "xxx"
}
},
"celery": {
"task_serializer": "json",
"accept_content": [
"json"
],
"result_serializer": "json",
"broker_url": "redis://:password@host:port/database",
"result_backend": "django-db",
"worker_concurrency": 2,
"timezone": "Asia/Shanghai",
"worker_max_tasks_per_child": 100
},
"application": {
"user_token_name": "User-Token",
"record_log": true,
"allowed_domain": [
"http://127.0.0.1",
"其他允许跨域的域名..."
]
}
}
3、 数据库迁移
python manage.py makemigrations
python manage.py migrate
4、同步权限
python manage.py sync_permission
5、创建帐号
python manage.py create_user user_name user_password 1 # 创建超级管理员
python manage.py create_user user_name user_password 0 # 创建普通用户
6、运行项目
python manage.py runserver host:port --noreload
gunicorn -c gunicorn.conf.py Alpha.wsgi
7、运行celery worker(独立于后端服务)
celery -A Alpha worker -l INFO
1、打包image文件
docker build -t wtp_backend:v1 .
2、运行镜像
docker run -itd --rm --name=wtp_back -p 8082:8082 -v /docker-data/application/wtp/:/Alpha/LOGS/ wtp_back:v1
-d # 后台运行
-v host_path:contanier_path
-p host_port:container_port
--rm # 关闭容器后删除
--name=xxx # 指定容器名字
```~~~~
3、进入镜像
docker exec -it wtp_back /bin/bash
4、执行deploy脚本
./deploy migrate # 首次部署 ./deploy permission # 首次部署 ./deploy start # 启动服务、celery worker
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。