-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7bc3b41
Showing
784 changed files
with
206,078 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from flask import Flask | ||
from flask import abort | ||
from flask import url_for | ||
|
||
app = Flask(__name__) | ||
|
||
@app.route('/') | ||
def hello_word(): | ||
return 'Hello World !' | ||
|
||
@app.route('/user/<username>') | ||
def show_user_profile(username): | ||
# show the user profile for that user | ||
return 'User %s' % username | ||
|
||
@app.route('/post/<int:post_id>') | ||
def show_post(post_id): | ||
# show the post with the given id, the id is an integer | ||
return 'Post %d' % post_id | ||
|
||
|
||
@app.route('/login', methods=['GET', 'POST']) | ||
def login(): | ||
if request.method == 'POST': | ||
do_the_login() | ||
else: | ||
show_the_login_form() | ||
|
||
if __name__ == '__main__': | ||
app.run(debug=True) |
Oops, something went wrong.