diff --git a/location_app/app/__init__.py b/location_app/app/__init__.py
index d3fc97f..b7c67fc 100644
--- a/location_app/app/__init__.py
+++ b/location_app/app/__init__.py
@@ -2,12 +2,18 @@ from flask import Flask
from app import mqtt, routes
-app = Flask(__name__)
-app.config.from_envvar('MYAPP_SETTINGS')
+def make_app():
+ """
+ Makes the app object with the configuration from
+ an environment variable and connects routes and mqtt
+ to the app
+ """
+ app = Flask(__name__)
+ app.config.from_envvar('MYAPP_SETTINGS')
-mqtt.init_app(app)
-
-routes.init_app(app)
+ mqtt.init_app(app)
+ routes.init_app(app)
+ return app
diff --git a/location_app/app/templates/main/index.html b/location_app/app/templates/main/index.html
index 9bc864d..55d925e 100644
--- a/location_app/app/templates/main/index.html
+++ b/location_app/app/templates/main/index.html
@@ -29,7 +29,7 @@
{% block body %}
{% if advanced %}
-
Your Locations
+
Your Locations
ID |
@@ -53,7 +53,7 @@
{% endfor %}
{% else %}
-
Your Locations
+
Your Locations
ID |
diff --git a/location_app/location_app.py b/location_app/location_app.py
index e524e69..0775eee 100644
--- a/location_app/location_app.py
+++ b/location_app/location_app.py
@@ -1 +1,3 @@
-from app import app
\ No newline at end of file
+from app import make_app
+
+app = make_app()
\ No newline at end of file