Skip to content

sreecodeslayer/sanic_todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo Application

This is a simple todo example of using Sanic with MongoDB Motor and User session management with Sanic-auth

Usage

  1. Clone this repository
  2. Install the requirements from requirements.txt by $ pip install -r requirements.txt
  3. 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 ```