Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion hello_app/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime
from flask import Flask, render_template
from flask import Flask, redirect, url_for,render_template
from . import app

@app.route("/")
Expand All @@ -14,6 +14,15 @@ def about():
def contact():
return render_template("contact.html")


#To test this function, On the Website you can simply add /url_for/
#To the end of the URL
@app.route("/url_for/")
def url_for_test_page():
return redirect(url_for('contact'))
#This will redirect the /url_for/ link to the contact page.


@app.route("/hello/")
@app.route("/hello/<name>")
def hello_there(name = None):
Expand Down