This is interesting. What if users have to put in their own inputs for the scripts? For instance, specify start-date and end-date for a sql query, or upload a spreadsheet to do the python analysis on?
You'd need to define a model which describes the form fields, handle it in your view, and add it to your page template.
forms.py
from flask_wtf import Form
from wtforms import TextField, PasswordField
from wtforms.validators import DataRequired
class LoginForm(Form):
email = TextField('Email', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
views.py
from forms import LoginForm
@app.route('/login', methods=('GET', 'POST'))
def login():
form = LoginForm()
if form.validate_on_submit():
email = form.data.get('email', None)
password = form.data.get('password', None)
do_login_stuff(email, password)
else:
return render_template('login_page.html', form=form)
# You need this for CSRF protection & cookie signing
SECRET_KEY = randomly_generated_secret_key
You should also look into Flask's blueprints at some point if it keeps growing. But it's not really essential, just another tool to help you keep projects organized. Flask is mostly "do whatever makes sense in your specific case" rather than imposing many global constraints on structure.
Also, I'd use gunicorn if you're deploying your own server. It's a bit less intimidating to get set up than uWSGI, and the main tradeoff is that it doesn't support quite as many thousands of users (i.e. not relevant).