1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 09:10:00 +00:00

utf8mb4 for database connection

This commit is contained in:
nyaadev 2017-05-23 00:46:26 +02:00
parent c6d4803e90
commit 76812b0ef0
2 changed files with 2 additions and 1 deletions

View file

@ -11,7 +11,7 @@ ENABLE_SHOW_STATS = False
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
if USE_MYSQL:
SQLALCHEMY_DATABASE_URI = ('mysql://test:test123@localhost/nyaav2')
SQLALCHEMY_DATABASE_URI = ('mysql://test:test123@localhost/nyaav2?charset=utf8mb4')
else:
SQLALCHEMY_DATABASE_URI = (
'sqlite:///' + os.path.join(BASE_DIR, 'test.db') + '?check_same_thread=False')

View file

@ -12,6 +12,7 @@ app.config.from_object('config')
# Database
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['MYSQL_DATABASE_CHARSET'] = 'utf8mb4'
# Don't refresh cookie each request
app.config['SESSION_REFRESH_EACH_REQUEST'] = False