diff options
author | Cédric Bonhomme <kimble.mandel+bitbucket@gmail.com> | 2015-04-12 15:46:06 +0200 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel+bitbucket@gmail.com> | 2015-04-12 15:46:06 +0200 |
commit | dba34e9840e812aff4b13978a958e4c01a0644d2 (patch) | |
tree | a882749ba2ab5090188bc2ab5987aec81eb57eb1 /bootstrap.py | |
parent | Updated bootstrap. (diff) | |
parent | improving look and feel of home page (diff) | |
download | newspipe-dba34e9840e812aff4b13978a958e4c01a0644d2.tar.gz newspipe-dba34e9840e812aff4b13978a958e4c01a0644d2.tar.bz2 newspipe-dba34e9840e812aff4b13978a958e4c01a0644d2.zip |
Merged in jaesivsm/pyaggr3g470r (pull request #8)
again miscellaneous improvements
Diffstat (limited to 'bootstrap.py')
-rw-r--r-- | bootstrap.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bootstrap.py b/bootstrap.py index 3b76d0ac..9c2ce049 100644 --- a/bootstrap.py +++ b/bootstrap.py @@ -6,6 +6,7 @@ import os import conf import logging +from urllib.parse import urlsplit def set_logging(log_path, log_level=logging.INFO, log_format='%(asctime)s %(levelname)s %(message)s'): @@ -22,8 +23,12 @@ from flask.ext.sqlalchemy import SQLAlchemy # Create Flask application application = Flask('pyaggr3g470r') application.debug = conf.WEBSERVER_DEBUG -set_logging(conf.LOG_PATH, log_level=logging.DEBUG if conf.WEBSERVER_DEBUG - else logging.INFO) +scheme, domain, _, _, _ = urlsplit(conf.PLATFORM_URL) +application.config['SERVER_NAME'] = domain +application.config['PREFERRED_URL_SCHEME'] = scheme + +set_logging(conf.LOG_PATH, + log_level=logging.DEBUG if conf.WEBSERVER_DEBUG else logging.INFO) # Create dummy secrey key so we can use sessions application.config['SECRET_KEY'] = getattr(conf, 'WEBSERVER_SECRET', None) |