Skeleton of sanic application to have tools same as Django
Which include:
- Auth system (already, alpha ver, need more tests)
- CSRF (already)
- Api methods (already)
How to run
main server
sanic server.app -H 0.0.0.0 -p 3141
api server
sanic api_server.app -H 0.0.0.0 -p 5000
database
i’m using Tortoise and Aerich for migrations with asyncpg
how to create database
CREATE DATABASE sanic_database
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'Russian_Russia.1251'
LC_CTYPE = 'Russian_Russia.1251'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
how to init database
aerich init -t db.TORTOISE_ORM
aerich init-db
aerich migrate --name init
aerich upgrade