|
@@ -22,18 +22,22 @@ app.config["SECRET_KEY"] = "secretkey"
|
|
|
app.register_blueprint(frontend)
|
|
|
nav.init_app(app)
|
|
|
|
|
|
-app.config["RELATIONSHIPS"] = json.loads(
|
|
|
- base64.b64decode(os.environ["PLATFORM_RELATIONSHIPS"])
|
|
|
-)
|
|
|
-app.redis = redis.StrictRedis(
|
|
|
- host=app.config["RELATIONSHIPS"]["redis"][0]["host"],
|
|
|
- port=app.config["RELATIONSHIPS"]["redis"][0]["port"],
|
|
|
- db=0,
|
|
|
-)
|
|
|
+relationships = os.environ.get("PLATFORM_RELATIONSHIPS", None)
|
|
|
+if relationships:
|
|
|
+ app.config["RELATIONSHIPS"] = json.loads(
|
|
|
+ base64.b64decode(relationships)
|
|
|
+ )
|
|
|
+ app.redis = redis.StrictRedis(
|
|
|
+ host=app.config["RELATIONSHIPS"]["redis"][0]["host"],
|
|
|
+ port=app.config["RELATIONSHIPS"]["redis"][0]["port"],
|
|
|
+ db=0,
|
|
|
+ )
|
|
|
+else:
|
|
|
+ app.redis = None
|
|
|
|
|
|
|
|
|
def get_token():
|
|
|
- return app.redis.get("token")
|
|
|
+ return app.redis.get("token") if app.redis else None
|
|
|
|
|
|
|
|
|
app.get_token = get_token
|