コード例 #1
0
 def test_my_custom_param(self):
     self.assertEqual('Hello World!', settings('MY_CUSTOM_PARAM'))
コード例 #2
0
def home():
    logger.info("Start {{cookiecutter.project_name}}")
    return "{{cookiecutter.project_name}} home: " + settings('MY_CUSTOM_PARAM')
コード例 #3
0
def main():
    logger.info("Start {{cookiecutter.project_name}}")
    docopt(__doc__)
    set_settings_module()
    logger.info("MY_CUSTOM_PARAM: %s" % settings('MY_CUSTOM_PARAM'))
コード例 #4
0
def main():
    logger.info("Start {{cookiecutter.project_name}}")
    docopt(__doc__)
    set_settings_module()
    logger.info("MY_CUSTOM_PARAM: %s" % settings('MY_CUSTOM_PARAM'))
コード例 #5
0
"""
Define the logger
"""

import logging
from environ import settings

# create logger
logger = logging.getLogger('{{cookiecutter.repo_name}}')
logger.setLevel(logging.INFO)

# create console handler and set level to debug
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)

# file handler
fh = logging.FileHandler(settings('LOG_FILE'))
fh.setLevel(logging.INFO)

# create formatter
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - \
%(message)s')

# add formatter
ch.setFormatter(formatter)
fh.setFormatter(formatter)

# add handlers to logger
logger.addHandler(ch)
logger.addHandler(fh)
コード例 #6
0
ファイル: server.py プロジェクト: unistra/bottle-drybones
def home():
    logger.info("Start {{cookiecutter.project_name}}")
    return "{{cookiecutter.project_name}} home: " + settings('MY_CUSTOM_PARAM')
コード例 #7
0
 def test_my_custom_param(self):
     self.assertEqual('Hello World!', settings('MY_CUSTOM_PARAM'))