diff --git a/run.py b/run.py
index 5c457256e3664e363c84fac887d244d221f77680..2c83cd48294e12c08a72c08a111b6008736a1df0 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 ecd2cdaf40daa9b103d394567aa46d51e693a914..0a3637c6db4e029e99d9ebbb1013e2bcab80cbdd 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)