Last active
April 5, 2020 20:55
-
-
Save bgweber/2abf451969644bacae54a766dc0c0a5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dash | |
from flask import Flask | |
from flask_dance.contrib.google import google as flask_google | |
from datetime import datetime | |
import dash_html_components as html | |
from dash_google_auth import GoogleOAuth | |
server = Flask(__name__) | |
server.config["GOOGLE_OAUTH_CLIENT_ID"] = 'YOUR_CLIENT_ID' | |
server.config["GOOGLE_OAUTH_CLIENT_SECRET"] = 'YOUR_CLIENT_SECRET' | |
server.secret_key = str(datetime.now()) | |
authorized_users = 'your_email@gmail.com' | |
app = dash.Dash(__name__, server=server) | |
auth = GoogleOAuth(app, authorized_users, [ 'openid' ] ) | |
app.layout = html.Div(children=[ | |
html.H3(children='Hello World!') | |
]) | |
if __name__ == '__main__': | |
app.run_server(host='0.0.0.0', port = 443, debug = False, ssl_context='adhoc') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment