Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FYI - Reproduce Web App Exercise #17

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
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
Next Next commit
Checkpoint 1
s2t2 committed Jun 17, 2021
commit 3f33de3627d595b3f7c95cc11a8981ac0db1ec97
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@ pandas
requests
sendgrid==6.6.0

Flask

#
# TEST
#
18 changes: 18 additions & 0 deletions web_app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# web_app/__init__.py

from flask import Flask

from web_app.routes.home_routes import home_routes
#from web_app.routes.book_routes import book_routes
#from web_app.routes.weather_routes import weather_routes

def create_app():
app = Flask(__name__)
app.register_blueprint(home_routes)
#app.register_blueprint(book_routes)
#app.register_blueprint(weather_routes)
return app

if __name__ == "__main__":
my_app = create_app()
my_app.run(debug=True)
18 changes: 18 additions & 0 deletions web_app/routes/home_routes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# web_app/routes/home_routes.py

from flask import Blueprint #, request, render_template

home_routes = Blueprint("home_routes", __name__)

@home_routes.route("/")
@home_routes.route("/home")
def index():
print("HOME...")
return "Welcome Home"
#return render_template("home.html")

@home_routes.route("/about")
def about():
print("ABOUT...")
return "About Me"
#return render_template("about.html")