Skip to content

Commit

Permalink
update3
Browse files Browse the repository at this point in the history
  • Loading branch information
csanicola74 committed Aug 31, 2022
1 parent 1d9c1dc commit 597b747
Show file tree
Hide file tree
Showing 11 changed files with 430 additions and 1 deletion.
Empty file added .history/app2_20220831172052.py
Empty file.
34 changes: 34 additions & 0 deletions .history/app2_20220831172118.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from markupsafe import escape
from flask import Flask, abort

app = Flask(__name__)


@app.route('/')
@app.route('/index/')
def hello():
return '<h1>Hello, World!</h1>'


@app.route('/about/')
def about():
return '<h3>This is a Flask web application.</h3>'


@app.route('/capitalize/<word>/')
def capitalize(word):
return '<h1>{}</h1>'.format(escape(word.capitalize()))


@app.route('/add/<int:n1>/<int:n2>/')
def add(n1, n2):
return '<h1>{}</h1>'.format(n1 + n2)


@app.route('/users/<int:user_id>/')
def greet_user(user_id):
users = ['Bob', 'Jane', 'Adam']
try:
return '<h2>Hi {}</h2>'.format(users[user_id])
except IndexError:
abort(404)
34 changes: 34 additions & 0 deletions .history/app2_20220831172648.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from markupsafe import escape
from flask import Flask, abort

app = Flask(__name__)


@app.route('/')
@app.route('/index/')
def hello():
return '<h1>Hello, World!</h1>'


@app.route('/about/')
def about():
return '<h3>This is a Flask web application.</h3>'


@app.route('/capitalize/<word>/')
def capitalize(word):
return '<h1>{}</h1>'.format(escape(word.capitalize()))


@app.route('/add/<int:n1>/<int:n2>/')
def add(n1, n2):
return '<h1>{}</h1>'.format(n1 + n2)


@app.route('/users/<int:user_id>/')
def greet_user(user_id):
users = ['Bob', 'Jane', 'Adam']
try:
return '<h2>Hi {}</h2>'.format(users[user_id])
except IndexError:
abort(404)
34 changes: 34 additions & 0 deletions .history/app2_20220831172653.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from markupsafe import escape
from flask import Flask, abort

app = Flask(__name__)


@app.route('/')
@app.route('/index/')
def hello():
return '<h1>Hello, World!</h1>'


@app.route('/about/')
def about():
return '<h3>This is a Flask web application.</h3>'


@app.route('/capitalize/<word>/')
def capitalize(word):
return '<h1>{}</h1>'.format(escape(word.capitalize()))


@app.route('/add/<int:n1>/<int:n2>/')
def add(n1, n2):
return '<h1>{}</h1>'.format(n1 + n2)


@app.route('/users/<int:user_id>/')
def greet_user(user_id):
users = ['Bob', 'Jane', 'Adam']
try:
return '<h2>Hi {}</h2>'.format(users[user_id])
except IndexError:
abort(404)
33 changes: 33 additions & 0 deletions .history/app_20220831171533.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# the below imports the Flask object from the flask package
from flask import Flask

# creating the Flask application instance and give it the name app
app = Flask(__name__)

# the decorator, @app.route, is being told with '/' that the function will respond to web requests for the URL '/'


@app.route('/')
# creates the 'index' page and the ability to navigate between pages
@app.route('/index/')
# creates the 'hello' function and then runs the phrase 'Hello, World!' through it
def hello():
return '<h1>Hello, World!</h1>'

# creates an 'about' page and function and runs the phrase through it


@app.route('/about/')
def about():
return '<h3>This is a Flask web application made by Caroline Sanicola.</h3>'

# creates a 'contact' page and function and runs the phrase through it


@app.route('/contact/')
def contact():
return '<h3>If you would like to contact us, please don\'t.</h3>'


if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=80)
33 changes: 33 additions & 0 deletions .history/app_20220831171930.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# the below imports the Flask object from the flask package
from flask import Flask,

# creating the Flask application instance and give it the name app
app = Flask(__name__)

# the decorator, @app.route, is being told with '/' that the function will respond to web requests for the URL '/'


@app.route('/')
# creates the 'index' page and the ability to navigate between pages
@app.route('/index/')
# creates the 'hello' function and then runs the phrase 'Hello, World!' through it
def hello():
return '<h1>Hello, World!</h1>'

# creates an 'about' page and function and runs the phrase through it


@app.route('/about/')
def about():
return '<h3>This is a Flask web application made by Caroline Sanicola.</h3>'

# creates a 'contact' page and function and runs the phrase through it


@app.route('/contact/')
def contact():
return '<h3>If you would like to contact us, please don\'t.</h3>'


if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=80)
33 changes: 33 additions & 0 deletions .history/app_20220831172024.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# the below imports the Flask object from the flask package
from flask import Flask, abort

# creating the Flask application instance and give it the name app
app = Flask(__name__)

# the decorator, @app.route, is being told with '/' that the function will respond to web requests for the URL '/'


@app.route('/')
# creates the 'index' page and the ability to navigate between pages
@app.route('/index/')
# creates the 'hello' function and then runs the phrase 'Hello, World!' through it
def hello():
return '<h1>Hello, World!</h1>'

# creates an 'about' page and function and runs the phrase through it


@app.route('/about/')
def about():
return '<h3>This is a Flask web application made by Caroline Sanicola.</h3>'

# creates a 'contact' page and function and runs the phrase through it


@app.route('/contact/')
def contact():
return '<h3>If you would like to contact us, please don\'t.</h3>'


if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=80)
Binary file added __pycache__/app.cpython-310.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# the below imports the Flask object from the flask package
from flask import Flask
from flask import Flask, abort

# creating the Flask application instance and give it the name app
app = Flask(__name__)
Expand Down
34 changes: 34 additions & 0 deletions app2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from markupsafe import escape
from flask import Flask, abort

app = Flask(__name__)


@app.route('/')
@app.route('/index/')
def hello():
return '<h1>Hello, World!</h1>'


@app.route('/about/')
def about():
return '<h3>This is a Flask web application.</h3>'


@app.route('/capitalize/<word>/')
def capitalize(word):
return '<h1>{}</h1>'.format(escape(word.capitalize()))


@app.route('/add/<int:n1>/<int:n2>/')
def add(n1, n2):
return '<h1>{}</h1>'.format(n1 + n2)


@app.route('/users/<int:user_id>/')
def greet_user(user_id):
users = ['Bob', 'Jane', 'Adam']
try:
return '<h2>Hi {}</h2>'.format(users[user_id])
except IndexError:
abort(404)
Loading

0 comments on commit 597b747

Please sign in to comment.