Firstly import:-
import hashlib, uuid
Then change your code according to this in your method:
uname = request.form["uname"]
pwd=request.form["pwd"]
salt = hashlib.md5(pwd.encode())
Then pass this salt and uname in your database sql query, below login is a table name:
sql = "insert into login values ('"+uname+"','"+email+"','"+salt.hexdigest()+"')"