Skip to content

Instantly share code, notes, and snippets.

@nilsdebruin
Created April 15, 2019 11:29
Show Gist options
  • Save nilsdebruin/0aa5b1259ff5bb669035976bab301a86 to your computer and use it in GitHub Desktop.
Save nilsdebruin/0aa5b1259ff5bb669035976bab301a86 to your computer and use it in GitHub Desktop.
Imports for FastAPI Basic
from typing import Optional
import base64
from passlib.context import CryptContext
from datetime import datetime, timedelta
import jwt
from jwt import PyJWTError
from pydantic import BaseModel
from fastapi import Depends, FastAPI, HTTPException
from fastapi.encoders import jsonable_encoder
from fastapi.security import OAuth2PasswordRequestForm, OAuth2
from fastapi.security.base import SecurityBase
from fastapi.security.utils import get_authorization_scheme_param
from fastapi.openapi.docs import get_swagger_ui_html
from fastapi.openapi.models import OAuthFlows as OAuthFlowsModel
from fastapi.openapi.utils import get_openapi
from starlette.status import HTTP_403_FORBIDDEN
from starlette.responses import RedirectResponse, Response, JSONResponse
from starlette.requests import Request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment