-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
257 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh -e | ||
# Datica post-build hook script | ||
# https://resources.datica.com/compliant-cloud/articles/buildpacks-custom/#pre-and-post-build-hooks | ||
|
||
FLASK_APP=manage.py flask sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,10 +50,7 @@ class BaseConfig(object): | |
CELERY_RESULT_BACKEND = 'redis' | ||
DEBUG = False | ||
DEFAULT_MAIL_SENDER = '[email protected]' | ||
LOG_FOLDER = os.environ.get( | ||
'LOG_FOLDER', | ||
os.path.join('/var/log', __package__) | ||
) | ||
LOG_FOLDER = os.environ.get('LOG_FOLDER', None) | ||
LOG_LEVEL = 'DEBUG' | ||
|
||
MAIL_USERNAME = '[email protected]' | ||
|
@@ -125,33 +122,3 @@ class TestConfig(BaseConfig): | |
|
||
WTF_CSRF_ENABLED = False | ||
FILE_UPLOAD_DIR = 'test_uploads' | ||
|
||
|
||
class ConfigServer(Server): # pragma: no cover | ||
"""Correctly read Flask configuration values when running Flask | ||
Flask-Script 2.0.5 does not read host and port specified in | ||
SERVER_NAME. This subclass fixes that. | ||
Bug: https://github.com/smurfix/flask-script/blob/7dfaf2898d648761632dc5b3ba6654edff67ec57/flask_script/commands.py#L343 | ||
Values passed in when instance is called as a function override | ||
those passed during initialization which override configured values | ||
See https://github.com/smurfix/flask-script/issues/108 | ||
""" | ||
def __init__(self, port=None, host=None, **kwargs): | ||
"""Override default port and host | ||
Allow fallback to configured values | ||
""" | ||
super(ConfigServer, self).__init__(port=port, host=host, **kwargs) | ||
|
||
def __call__(self, app=None, host=None, port=None, *args, **kwargs): | ||
"""Call app.run() with highest precedent configuration values""" | ||
# Fallback to initialized value if None is passed | ||
port = self.port if port is None else port | ||
host = self.host if host is None else host | ||
super(ConfigServer, self).__call__(app=app, host=host, | ||
port=port, *args, **kwargs) |
Oops, something went wrong.