multidb
This commit is contained in:
14
app.py
14
app.py
@@ -178,13 +178,13 @@ def load_user(user_id):
|
||||
|
||||
@event.listens_for(Engine, "connect")
|
||||
def set_sqlite_pragma(dbapi_connection, connection_record):
|
||||
try:
|
||||
cursor = dbapi_connection.cursor()
|
||||
cursor.execute("PRAGMA foreign_keys=ON")
|
||||
cursor.close()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if dbapi_connection.__class__.__module__.startswith('sqlite3'):
|
||||
try:
|
||||
cursor = dbapi_connection.cursor()
|
||||
cursor.execute("PRAGMA foreign_keys=ON")
|
||||
cursor.close()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def get_real_ip():
|
||||
headers = request.headers
|
||||
|
Reference in New Issue
Block a user