Почему не работает код?
from flask import Flask
from flask import request
from flask import render_template
import registration
app = Flask(__name__)
@app.route("/")
def index():
return render_template("registration.html")
@app.route("/registration", methods=['POST', 'GET'])
def registration():
email=request.form['email']
password=request.form['password']
registration.reg(email,password)
return "Ok!"
if __name__ == "__main__":
app.run(host='0.0.0.0')
#registration
def email(email):
import re
if(email):
pattern=r"^[a-zA-Z0-9]{1,100}[@][a-z]{2,6}\.[a-z]{2,4}"
number_re=re.compile(pattern)
if number_re.findall(email):
return email
def password(password):
if(password):
if(len(password) >= 8):
return password
def passwordmd5(password):
import hashlib
if(password):
hsh=hashlib.md5()
hsh.update(password)
md5=hsh.hexdigest()
return md5
def reg(v_email,v_password):
v_email=email(v_email)
v_password=password(v_password)
v_password=passwordmd5(v_password)
return "reegistration continie"