-
-
Save jennielees/26e1f5703b2ba29471bd to your computer and use it in GitHub Desktop.
Skeleton users app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def show_index_page(): | |
### Show an index page offering the option to Sign Up or Log In | |
@app.route('/login') | |
def show_login_page(): | |
### Show the login page | |
@app.route('/submit-login', methods=['POST']) | |
def submit_login_form(): | |
### Submit the login form | |
### Redirect to logged-in page | |
@app.route('/signup') | |
def show_signup_page(): | |
### Show the signup page | |
@app.route('/submit-signup', methods=['POST']) | |
def submit_signup_form(): | |
### Submit the signup form | |
### Redirect to logged-in page | |
@app.route('/logged-in') | |
def show_logged_in_page(): | |
### Show a placeholder page that only displays when you have logged in | |
@app.route('/admin') | |
def list_all_users(): | |
### Show a list of all the users (admin page) | |
if __name__=='__main__': | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment