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

DS14 #180

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

DS14 #180

Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
flask = "*"

[requires]
python_version = "3.7"
95 changes: 95 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
return "Hello World!"
18 changes: 18 additions & 0 deletions web_app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# what init is for
# entry point into a specifiy directory
# first place python will look for files
from flask import Flask

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

# application factory pattern
def create_app():
app = Flask(__name__)
app.register_blueprint(home_routes)
#app.register_blueprint(book_routes)
return app

if __name__ == "__main__":
my_app = create_app()
my_app.run(debug=True)
Empty file added web_app/read.me
Empty file.
12 changes: 12 additions & 0 deletions web_app/routes/home_routes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from flask import Blueprint

home_routes = Blueprint("home_routes", __name__)

@home_routes.route("/")
def index():
x = 2 + 2
return f"Hello World! {x}"

@home_routes.route("/about")
def about():
return "About me"