Index: src/mapservice/codegen/code_generator
===================================================================
--- src/mapservice/codegen/code_generator	(revision ae2ff15d6963a93c67e87e175ea31292b8bb3d28)
+++ src/mapservice/codegen/code_generator	(revision 5c9c24749986dcbc6e8d7597d3dfe3d0e00dc625)
@@ -57,4 +57,5 @@
 chmod +x "${CELERY_WORKER_SCRIPT}"
 
+# bash script to install gnuboat_common from this repository before other dependencies
 echo "#!/bin/bash" > "${TOX_INSTALL_COMMAND}"
 echo 'pip install --editable=file:///`pwd`/../../common' >> "${TOX_INSTALL_COMMAND}"
@@ -62,5 +63,8 @@
 chmod 0755 "${TOX_INSTALL_COMMAND}"
 
-echo "include gnuboat_mapservice/openapi/*.yaml gnuboat_mapservice/templates/*" > "${SRC_GEN}/MANIFEST.in"
+# create MANIFEST.in to package openapi-spec and templates
+echo "include gnuboat_mapservice/openapi/*.yaml" > "${SRC_GEN}/MANIFEST.in"
+echo "graft gnuboat_mapservice/templates" >> "${SRC_GEN}/MANIFEST.in"
+echo "global-exclude *.pyc" >> "${SRC_GEN}/MANIFEST.in"
 
 ########
Index: src/mapservice/codegen/templates/__init__test.mustache
===================================================================
--- src/mapservice/codegen/templates/__init__test.mustache	(revision ae2ff15d6963a93c67e87e175ea31292b8bb3d28)
+++ src/mapservice/codegen/templates/__init__test.mustache	(revision 5c9c24749986dcbc6e8d7597d3dfe3d0e00dc625)
@@ -28,4 +28,5 @@
 
 		application.config.from_object('{{packageName}}.server_impl.Config.TestingConfig')
+		application.template_folder = os.path.join(os.path.dirname(__file__), '../templates')
 		celery = Celery(__name__, broker=application.config['CELERY_BROKER_URL'])
 		celery.config_from_object(application.config)
Index: src/mapservice/codegen/templates/__main__.mustache
===================================================================
--- src/mapservice/codegen/templates/__main__.mustache	(revision ae2ff15d6963a93c67e87e175ea31292b8bb3d28)
+++ src/mapservice/codegen/templates/__main__.mustache	(revision 5c9c24749986dcbc6e8d7597d3dfe3d0e00dc625)
@@ -6,8 +6,10 @@
 {{/supportPython2}}
 
+import os
+
 from {{packageName}}.server_impl import app, application, mail, celery, setup_app, config_object
 
 def main():
-	setup_app('{{appName}}', config_object)
+	setup_app('{{appName}}', config_object, template_folder = os.path.join(os.path.dirname(__file__), 'templates'))
 	app.run(host=application.config.get("HOST", "localhost"), port=application.config.get("PORT", {{serverPort}}))
 
Index: src/mapservice/server_impl/Config.py
===================================================================
--- src/mapservice/server_impl/Config.py	(revision ae2ff15d6963a93c67e87e175ea31292b8bb3d28)
+++ src/mapservice/server_impl/Config.py	(revision 5c9c24749986dcbc6e8d7597d3dfe3d0e00dc625)
@@ -63,4 +63,6 @@
 class ProductionConfig(Config):
 	SQLALCHEMY_DATABASE_URI = 'mysql://gnuboat:gnuboat@localhost/gnuboat_mapservice'
+	# TEMPLATE_FOLDER could be used to use own templates residing in TEMPLATE_FOLDER
+	TEMPLATE_FOLDER='/usr/share/gnuboat/templates'
 
 class DevelopmentConfig(Config):
Index: src/mapservice/server_impl/__init__.py
===================================================================
--- src/mapservice/server_impl/__init__.py	(revision ae2ff15d6963a93c67e87e175ea31292b8bb3d28)
+++ src/mapservice/server_impl/__init__.py	(revision 5c9c24749986dcbc6e8d7597d3dfe3d0e00dc625)
@@ -65,8 +65,13 @@
 	return render_template('index.html')
 
-def setup_app(app_name, config):
+def setup_app(app_name, config, template_folder = None):
 	application.json_encoder = encoder.JSONEncoder
 	app.add_api('openapi.yaml', arguments={'title': app_name}, validate_responses=True, strict_validation=True, validator_map={'response': ValidatorWorkaround})
 	application.config.from_object(config)
+	
+	if 'TEMPLATE_FOLDER' in application.config:
+		application.template_folder = application.config['TEMPLATE_FOLDER']
+	elif template_folder:
+		application.template_folder = template_folder
 
 	db.init_app(application)
