Skip to content
/ fastapi-template Public template

FastAPI框架的模板,可以与angular-dashboard-template配合

License

Notifications You must be signed in to change notification settings

wikylyu/fastapi-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastapi-template

FastAPI 框架的模板,可以与angular-dashboard-template配合

Consul 配置

此项目使用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.pyTableBase的**_table_prefix**属性。

可以用以下方式创建数据库:

CREATE DATABASE template WITH ENCODING=UTF-8;
\c tempalte;
\i doc/schema.sql;

About

FastAPI框架的模板,可以与angular-dashboard-template配合

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages