Skip to content
This repository has been archived by the owner. It is now read-only.
A full personal website, qwerty = homepage + blog + wiki + resume ...
Python Other
  1. Python 99.0%
  2. Other 1.0%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
src
.dockerignore
.gitignore
Dockerfile
LICENSE
README.md
config_example.yml
requirements.txt
startup.sh
supervisor-app.conf
uwsgi.ini

README.md

qwerty-server

qwerty 的 API server。

部署

默认提供了 Dockerfile 文件,支持 Docker 部署,也推荐使用 Docker。

  1. 安装 MySQL@5.7,创建存储库和数据库账户密码
  2. cp ./config_example.yml /etc/qwerty.yml,根据你的网站信息修改配置文件
  3. 创建日志目录,mkdir -p /data/log
  4. 构建镜像: docker build -t ${image_name} .
  5. 启动服务: docker run --name qwerty-server -it -d -p 8080:8080 -v /etc/qwerty.yml:/etc/qwerty.yml -v /data/log/:/data/log/ ${image_name}

测试服务是否正常运行:curl 0.0.0.0:8080/health_check,得到 {"status": "ok"} 表示运行正常。

开发

安装开发环境:

  1. 安装 MySQL@5.7
    • macOS:brew install mysql@5.7
  2. 创建数据库并授权:
    • create database qwerty charset=utf8mb4
    • grant all privileges on qwerty.* to qwerty_user@'localhost' identified by 'qwerty_password'
  3. 安装依赖库: pip3 install -r requirements.txt
  4. 复制一份配置文件,修改配置: cp config_example.yml config.yml

迁移数据库,运行服务:

CONFIG_FILE=./config.yml ./manage.py migrate
CONFIG_FILE=./config.yml ./manage.py runserver
You can’t perform that action at this time.