generated from nighthawkcoders/flask_portfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
26 lines (21 loc) · 990 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# import "packages" from flask
from flask import render_template # import render_template from "public" flask libraries
# import "packages" from "this" project
from __init__ import app # Definitions initialization
from api import app_api # Blueprint import api definition
from bp_projects.projects import app_projects # Blueprint directory import projects definition
app.register_blueprint(app_api) # register api routes
app.register_blueprint(app_projects) # register api routes
@app.errorhandler(404) # catch for URL not found
def page_not_found(e):
# note that we set the 404 status explicitly
return render_template('404.html'), 404
@app.route('/') # connects default URL to index() function
def index():
return render_template("index.html")
@app.route('/Aboutme/') # connects /stub/ URL to stub() function
def stub():
return render_template("stub.html")
# this runs the application on the development server
if __name__ == "__main__":
app.run(debug=True)