Giter VIP home page Giter VIP logo

sanic-demo's Introduction

sanic-demo

sanic 模板,sanic + tortoise-orm + aiomysql + aioredis

环境

  • Python-3.7.10
    • sanic==21.9.1
    • aiomysql==0.0.21
    • tortoise-orm==0.17.8
    • aioredis==2.0.0

文件组织结构

.sanic-demo
├── app                       # app
│   ├── __init__.py
│   ├── blue.py               # 总蓝图
│   ├── demo                  # demo模块
│   │   ├── __init__.py
│   │   ├── blue.py           # demo蓝图
│   │   └── views.py          # demo视图
│   ├── models.py             # tortiose-orm模型
│   └── user                  # 用户模块
│       ├── __init__.py
│       ├── blue.py           # 用户蓝图
│       └── views.py          # 用户视图
├── settings                  # 配置
│   ├── __init__.py           # 获取配置方法
│   ├── base.py               # 配置基类
│   ├── development.py        # 开发环境配置
│   └── production.py         # 生产环境配置
├── core
│   ├── error_code.py         # 错误码
│   ├── exception_handlers    # 异常处理器
│   │   ├── base.py           # 异常处理基类
│   │   ├── error_code.py     # 错误码异常处理
│   │   ├── __init__.py
│   │   └── unknown.py        # 未知异常处理
│   ├── __init__.py
│   ├── listeners             # 监听
│   │   ├── __init__.py
│   │   ├── base.py           # 监听基类
│   │   └── redis.py          # redis监听
│   ├── middlewares           # 中间件
│   │   ├── __init__.py
│   │   ├── base.py           # 中间件基类
│   │   ├── redis.py          # redis中间件
│   │   └── timer.py          # 计时中间件
│   └── response.py           # 响应函数
├── libs                      # 公共库
│   ├── config.py             # 配置文件处理方法
│   ├── error_code            # 错误码处理
│   │   ├── __init__.py
│   │   ├── enum.py           # 错误码枚举
│   │   └── exception.py      # 错误码异常
│   ├── __init__.py
│   ├── logger.py             # logger
│   └── secret_key.py         # 生成secret_key方法
├── logs                      # 日志文件存储路径
├── manage.py                 # 启动文件
├── .env_bak                  # 配置文件模板,需要拷贝为.env
└── requirements.txt

sanic-demo's People

Contributors

liuseki avatar sekil9529 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.