From b0ce2e5ad01939fbd507e14b2385c67749dd589a Mon Sep 17 00:00:00 2001
From: Julian Rother <julianr@fsmpi.rwth-aachen.de>
Date: Thu, 8 Sep 2016 14:25:05 +0200
Subject: [PATCH] Fix debug mode detection for default config

---
 run.py    | 2 --
 server.py | 3 ++-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/run.py b/run.py
index 5c45725..2c83cd4 100755
--- a/run.py
+++ b/run.py
@@ -1,7 +1,5 @@
 #!/usr/bin/env python
 from server import *
 
-global is_debug
-is_debug = True
 if __name__ == '__main__':
 	app.run(threaded=True)
diff --git a/server.py b/server.py
index ecd2cda..0a3637c 100755
--- a/server.py
+++ b/server.py
@@ -4,6 +4,7 @@ from functools import wraps
 from datetime import date, timedelta, datetime, time, MINYEAR
 import threading
 import os
+import sys
 import hashlib
 import random
 
@@ -24,7 +25,7 @@ timer.start()
 
 config = app.config
 config.from_pyfile('config.py.example', silent=True)
-if 'is_debug' in globals(): 
+if not sys.argv[0].endswith('run.py'): 
 	config['SQLITE_INIT_DATA'] = False
 	config['DEBUG'] = False
 config.from_pyfile('config.py', silent=True)
-- 
GitLab