From 3d4cc41c277aa08a7e80d54162a527aa4355bcab Mon Sep 17 00:00:00 2001 From: Filip Valder Date: Tue, 6 Dec 2016 13:44:04 +0100 Subject: [PATCH] use just once during upgradedb otherwise frontend's request processing is out of application context From docs: Setting a SERVER_NAME also by default enables URL generation without a request context but with an application context. --- conf/config.py | 1 - module_build_service/manage.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/config.py b/conf/config.py index 319667b1..29564323 100644 --- a/conf/config.py +++ b/conf/config.py @@ -15,7 +15,6 @@ class BaseConfiguration(object): dbdir, 'module_build_service.db')) SQLALCHEMY_TRACK_MODIFICATIONS = True # Where we should run when running "manage.py runssl" directly. - SERVER_NAME = 'localhost' HOST = '127.0.0.1' PORT = 5000 diff --git a/module_build_service/manage.py b/module_build_service/manage.py index 18215ac3..9b4a7bf7 100644 --- a/module_build_service/manage.py +++ b/module_build_service/manage.py @@ -100,6 +100,7 @@ def testpdc(): def upgradedb(): """ Upgrades the database schema to the latest revision """ + app.config["SERVER_NAME"] = 'localhost' # TODO: configurable? migrations_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'migrations')