This is a simple todo example of using Sanic with MongoDB Motor and User session management with Sanic-auth
- Clone this repository
- Install the requirements from
requirements.txt
by$ pip install -r requirements.txt
- Serve using gunicorn :
$ gunicorn app:app --worker-class sanic.worker.GunicornWorker
You might want to change Mongo Auth in
app.py
def get_client():
from motor.motor_asyncio import AsyncIOMotorClient
from sanic import app
client = AsyncIOMotorClient(host="mongodb://rootuser:passme123@localhost:27045", io_loop=app.get_event_loop())
return client ```