由于上游 Graphene 被其创始人遗弃,本项目流产
安装 poetry
进阶用法,使用 pyenv + poetry 管理你的虚拟环境。
重启 shell 后,执行
poetry install --no-dev -E {mysql or pgsql}
上述命令中中括号内根据实际需要二选一即可
poetry run python -c 'import django.core.management.utils;print(django.core.management.utils.get_random_secret_key())'
待补充
如已有原数据,无需执行本步骤,只需进行数据库的迁移即可
poetry run python manage.py makemigrations
poetry run python manage.py migrate
poetry run python manage.py compilemessages
待补充
安装 Nginx 并参考如下配置
location / {
proxy_pass http://127.0.0.1:10801;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /static {
alias /path/to/project/assets;
expires 12h;
error_log /dev/null;
access_log off;
}
location /media {
alias /path/to/project/media;
expires 30d;
error_log /dev/null;
access_log off;
}