FastAPI 框架的模板,可以与angular-dashboard-template配合
此项目使用consul的 KV 功能作为配置服务,具体配置如下:
- template/http
{
"session": "aze4e6a5ab7903d9ab587e7b0xaac184750250",
"cors": {
"AllowOrigins": ["http://127.0.0.1:4200"],
"AllowCredentials": true
}
}
- template/db
{
"psql": {
"dsn": "postgresql://postgres@127.0.0.1/template?sslmode=disable"
}
}
- template/tencent
{
"secretid": "",
"secretkey": "",
"region": "ap-nanjing",
"sms": {
"signname": "测试签名",
"appid": "",
"templates": {
"phonecode": "1231111"
}
}
}
- template/redis
{
"prefix": "t_",
"host": "127.0.0.1",
"port": 6379,
"password": "",
"db": 0
}
此项目使用 PostgreSQL 作为关系数据库。具体数据表定义在doc/schema.sql。
根据需要修改数据表的前缀,默认为t_,同时需要修改文件db/psql.py中TableBase的**_table_prefix**属性。
可以用以下方式创建数据库:
CREATE DATABASE template WITH ENCODING=UTF-8;
\c tempalte;
\i doc/schema.sql;