Skip to content

exhyy/online_payment_app_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

online_payment_app_api

北京交通大学《数据库系统原理》课程设计应用服务器代码,基于Django构建,请参考官方文档。 前端在这里

使用

安装Python依赖

本项目使用Python 3.18.16,需运行在linux服务器下 运行pip install -r requirements.txt安装依赖

安装redis

本项目需要使用redis作为应用服务器缓存

sudo apt update
sudo apt install redis-server

连接数据库服务器

在项目根目录下新建my.cnf文件(该文件会被git忽略),然后按照MySQL服务器配置的格式填写即可。示例如下:

[client]
host = 10.101.1.50
database = online_payment
user = xiaoming
password = 123456
default-character-set = utf8

配置并发支持

本应用服务器通过gunicorn实现并发,配置文件为gunicorn_conf.py。bind表示服务器端口,workers控制进程数。

启动服务器

部署命令如下:

PYTHONPATH=<项目上级目录> gunicorn -c gunicorn_conf.py online_payment_api.wgsi:application

如果只想使用单进程,或者需要调试服务器,则直接运行:

python manage.py runserver

About

北京交通大学(BJTU)《数据库系统原理》课程设计

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages