From d75c7fdb5045ed2cf64c8db4bd010bd64316d348 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Tue, 24 Nov 2015 23:14:42 +0000 Subject: Yet another private Django config that needed to be kludged to charset latin1 to work around MySQL 5.6 insanity. Fixes #782 (again). svn path=/trunk/; revision=6193 --- rpki/gui/script_util.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'rpki') diff --git a/rpki/gui/script_util.py b/rpki/gui/script_util.py index 43a53bc6..c8248527 100644 --- a/rpki/gui/script_util.py +++ b/rpki/gui/script_util.py @@ -33,6 +33,11 @@ def setup(): cfg = config.parser(section='web_portal') # INSTALLED_APPS doesn't seem necessary so long as you are only accessing # existing tables. + # + # Setting charset to latin1 is a disgusting kludge, but without + # this MySQL 5.6 (and, proably, later) gets tetchy about ASN.1 DER + # stored in BLOB columns not being well-formed UTF8 (sic). If you + # know of a better solution, tell us. settings.configure( DATABASES={ 'default': { @@ -40,6 +45,9 @@ def setup(): 'NAME': cfg.get('sql-database'), 'USER': cfg.get('sql-username'), 'PASSWORD': cfg.get('sql-password'), + 'OPTIONS': { + 'charset': 'latin1', + } } }, MIDDLEWARE_CLASSES = (), -- cgit v1.2.3