nodequery-server 基于nodequery.com的开源客户端开发的服务端。
python3 django3 mysql mongodb celery
- 安装python3,pip3
- 克隆项目代码,或者下载ZIP解压
- 安装依赖:pip -r requirement.txt
- 安装mysql(>=5.7),mongodb(>=4.2)
- 配置项目录下nqmonitor/setting.py 根据注释填写mysql和mongodb的信息,注意数据库名为nqmonitor
- 安装gunicorn和supervisor,配置django 进程守护
- 安装nginx并配置gunicorn代理
- 安装lnmp,具体见:https://lnmp.org/install.html, 本步骤只是为了安装nginx/mysql环境,可以用yum或者其他类似面板替代如(BT,AMH等)
- 安装python3,pip3, 具体可以参考https://blog.csdn.net/qq_36357820/article/details/89631712
- 克隆本项目或者下载ZIP解压到 你的目录,比如/home/wwwroot/
- 在项目目录下安装依赖,执行 pip -r requirement.txt, 或者安装pipenv创建虚拟ENV
- 在mysql和mongodb中创建数据库nqmonitor.
- 在项目目录下nqmonitor/setting.py中 填写mysql数据库账号密码,以及mongodb账号密码,文件中有如何填写的注释。
- 执行python manage.py makemigrations
- 执行python manage.py migrate 创建mysql表
- 执行python manage.py createsuperuser 创建超级用户。
- 安装gunicron 执行:pip install gunicron
- 安装supervisor 执行:pip install supervisor
- 配置supervisor 守护django 进程, supervisor教程:http://www.awkxy.com/Linux/supervisor.html
- 配置nginx反代,绑定域名
- 完工
docker-compose
//运行容器
1. docker-compose up -d
//创建管理员帐号
2. docker-compose exec nodequery python manage.py createsuperuser
- 安装脚本在/static/sh 目录下,请把域名替换成你的域名。
- 首页代码在templates/index.html 需要修改的自行编辑
- 修改网站名称的,请前往 templates/layout/base.html