This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
uwu-me/app.py
2020-03-01 21:00:01 -06:00

24 lines
853 B
Python

from .lib.helpers import get_static_paths, get_content_text
from flask import Flask, render_template, redirect, url_for, request
app = Flask(__name__)
@app.route('/login', methods=['GET', 'POST'])
def login():
if(request.method == 'POST'):
if request.form['username'] != 'admin' or request.form['password'] != 'admin':
error = 'Invalid Credentials. Please try again.'
else:
return redirect(url_for('home'))
elif(request.method == 'GET'):
return render_template('login/index.html', static_paths=get_static_paths(), content_text=get_content_text())
return 'ERROR: Invalid method.'
@app.route("/", methods=['GET'])
def hello():
return render_template('homepage.html', static_paths=get_static_paths(), content_text=get_content_text())
def main():
app.run(host='0.0.0.0', debug=True)