diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-04-08 12:33:40 +0200 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-04-12 14:31:06 +0200 |
commit | b343dc73e5ea4aaf1314b6b277c3806f15ac0635 (patch) | |
tree | ad31cf775685f51977b9a6dcad9e255e9087302f /bootstrap.py | |
parent | Updated bootstrap. (diff) | |
download | newspipe-b343dc73e5ea4aaf1314b6b277c3806f15ac0635.tar.gz newspipe-b343dc73e5ea4aaf1314b6b277c3806f15ac0635.tar.bz2 newspipe-b343dc73e5ea4aaf1314b6b277c3806f15ac0635.zip |
moving feed views related code in views.feed and massive use of url_for
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) |