Commit 7b78e962 authored by Masarath Fatima's avatar Masarath Fatima

Delete sample.py

parent f107d111
from flask import Flask, flash, redirect, render_template,request, url_for
from wtforms import Form,SelectField
from onpremisesdatabases import sqlserver1, postgres1, mysql1
from registrationform import RegistrationForm
app = Flask(__name__)
app.secret_key ="MY_SECRET_KEY"
@app.route('/', methods=['GET', 'POST'])
def register():
form = RegistrationForm(request.form)
if request.method == 'POST' and form.validate():
if form.db_name == "My SQl":
return mysql1
elif form.db_name == "Postgres":
return postgres1
elif form.db_name == "SQL Server":
return sqlserver1
flash('Thanks for registering')
return redirect(url_for('thankyou'))
return render_template('db.html', form=form)
if __name__ =="__main__":
app.run(debug=True,port=1234)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment