source: src/mapservice/codegen/templates/__main__.mustache@ ff880df

debian/bullseye
Last change on this file since ff880df was 5c9c247, checked in by Joachim Langenbach <joachim.langenbach@…>, 7 years ago

To find the template files, when started per installed package and per module from src-gen

  • Folder for templates is now set (in the descending priority)
    • per Config option TEMPLATE_FOLDER
    • per template_folder optional argument to setup_app(). The option is set by main.py (see mustache)

For tests the template_folder is set by init.py from test folder (s. inittest.mustache)

  • Property mode set to 100644
File size: 508 bytes
RevLine 
[3a89adb]1{{#supportPython2}}
2#!/usr/bin/env python
3{{/supportPython2}}
4{{^supportPython2}}
5#!/usr/bin/env python3
6{{/supportPython2}}
7
[5c9c247]8import os
9
[096625e]10from {{packageName}}.server_impl import app, application, mail, celery, setup_app, config_object
[3a89adb]11
12def main():
[5c9c247]13 setup_app('{{appName}}', config_object, template_folder = os.path.join(os.path.dirname(__file__), 'templates'))
[a88607b]14 app.run(host=application.config.get("HOST", "localhost"), port=application.config.get("PORT", {{serverPort}}))
[3a89adb]15
16if __name__ == '__main__':
17 main()
Note: See TracBrowser for help on using the repository browser.