Beispiel #1
0
def test_init(app):
    """Test initialisation."""

    authorized_emails = ['*****@*****.**']
    auth = GoogleOAuth(app, authorized_emails)

    assert auth.app is app
    assert auth.authorized_emails == authorized_emails
server.config["GOOGLE_OAUTH_CLIENT_SECRET"] =  # client secret
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
os.environ['OAUTHLIB_RELAX_TOKEN_SCOPE'] = '1'

APPLICATION = APP.server


APP.layout = html.Div([
    navbar,
    dcc.Location(id='url', refresh=False),
    html.Div(className="container main-container", children=[])


    authorized_emails=[]
    auth=GoogleOAuth(
        APP,
        authorized_emails,
    )


    @APP.callback(
        Output('username', 'children'),
        [Input('placeholder', 'value')]
    )
    def on_load(value):
        return "{},".format(session['email'])




    @APP.callback(dash.dependencies.Output('page-content', 'children'),
                  [dash.dependencies.Input('url', 'pathname')])
Beispiel #3
0
from selenium.webdriver.chrome.options import Options
import selenium.webdriver.chrome.service as service

# file imports
# from API_KEYS import *
# from etl import *

# configure app & google auth stuff
server = Flask(__name__)
server.wsgi_app = ProxyFix(server.wsgi_app)

app = dash.Dash(__name__, server=server, url_base_pathname='/', auth='auth')

authorized_emails = ['*****@*****.**']
auth = GoogleOAuth(
    app,
    authorized_emails,
)


@server.route("/")
def MyDashApp():
    return app.index()


@server.route("/static")
def hello():
    message = "This app does not collect or store user data past using your email to login. We do not track your web activity."
    return render_template('index.html', message=message)


# configure google oauth using environment variables