Index: src/mapservice/codegen/code_generator
===================================================================
--- src/mapservice/codegen/code_generator	(revision ae2ff15d6963a93c67e87e175ea31292b8bb3d28)
+++ src/mapservice/codegen/code_generator	(revision a2b80527e9200b6feac74d75840bf6c8c3a26916)
@@ -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 a2b80527e9200b6feac74d75840bf6c8c3a26916)
@@ -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 a2b80527e9200b6feac74d75840bf6c8c3a26916)
@@ -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}}))
 
