-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.py.save
30 lines (23 loc) · 902 Bytes
/
index.py.save
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import flask
from flask import Flask, render_template, request,redirect, url_for
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import callbacks
from app import app, server
from layouts import dashboard
@server.route('/')
def index():
return render_template('home.html')
@server.route('/result', methods = ['POST', 'GET'])
def result():
#Authentication Logic
if request.method == 'POST' and request.form['username'] == 'admin' and request.form['pass'] == '123456' :
print('llego del boton marica')
print('POST con usuario {} con password {}'.format(request.form['username'],request.form['pass']))
return redirect(url_for('/dash/'))
else:
return 'logged faild, check your credentials...'
app.layout = dashboard
if __name__ == '__main__':
app.run_server(debug=True, port=5000)