text: from flask import Flask, flash, redirect, render_template, request, url_for
  from werkzeug import secure_filename
  
  app = Flask(__name__)
  app.secret_key = 'random string'
  
  
  @app.route('/')
  def index():
      return render_template('index.html')
  
  
  @app.route('/login', methods=['GET', 'POST'])
  def login():
      error = None
  
      if request.method == 'POST':
          if request.form['username'] != 'admin' or \
                          request.form['password'] != 'admin':
              error = 'Invalid username or password. Please try again!'
          else:
              flash('You were successfully logged in')
              return redirect(url_for('index'))
  
      return render_template('login.html', error=error)
  
  
  @app.route('/upload')
  def upload_file():
      return render_template('upload.html')
  
  
  @app.route('/uploader', methods=['GET', 'POST'])
  def uploader():
      if request.method == 'POST':
          f = request.files['file']
          f.save(secure_filename(f.filename))
          return 'file uploaded successfully'
  
  if __name__ == "__main__":
      app.run(host='0.0.0.0', debug=True)