Created base flask instance and moved static templates into correct location so they can be loaded using Jinja
This commit is contained in:
parent
f64c378248
commit
1c5aa09668
@ -1 +0,0 @@
|
||||
|
14
app.py
14
app.py
@ -1,4 +1,16 @@
|
||||
from flask import Flask, render_template
|
||||
from web import blueprint
|
||||
'''
|
||||
Main entrypoint for Flask application.
|
||||
Initialises any components that are needed at runtime such as the
|
||||
Database manager...
|
||||
'''
|
||||
def main():
|
||||
app = Flask(__name__)
|
||||
|
||||
# Register a blueprint
|
||||
app.register_blueprint(blueprint)
|
||||
app.run(debug=True)
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Hello, World!")
|
||||
main()
|
||||
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
5
web/__init__.py
Normal file
5
web/__init__.py
Normal file
@ -0,0 +1,5 @@
|
||||
from flask import Blueprint
|
||||
|
||||
blueprint = Blueprint('endpoints', __name__)
|
||||
|
||||
from . import endpoints
|
9
web/endpoints.py
Normal file
9
web/endpoints.py
Normal file
@ -0,0 +1,9 @@
|
||||
from . import blueprint
|
||||
from flask import render_template
|
||||
|
||||
'''
|
||||
Function responsible for displaying the main landing page of the site
|
||||
'''
|
||||
@blueprint.route('/')
|
||||
def welcome_page():
|
||||
return render_template('index.html')
|
Loading…
Reference in New Issue
Block a user