Skip to content

Instantly share code, notes, and snippets.

@philmade
Created March 5, 2020 11:19
Show Gist options
  • Save philmade/987261ae3f91dcd3c76942a851fafd4e to your computer and use it in GitHub Desktop.
Save philmade/987261ae3f91dcd3c76942a851fafd4e to your computer and use it in GitHub Desktop.
from fastapi import FastAPI
app = FastAPI()
@app.get('/')
def index(request: Request, db: Session = Depends(get_db),
current_user: models.User = Depends(current_user)):
users = crud.get_channels(db, skip=0, limit=100)
return templates.TemplateResponse('index.html', {"title": 'home',
"users": users,
"request": request,
"current_user": current_user
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment