File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5959 'sqlite' : 'django.db.backends.sqlite3' ,
6060}
6161
62+ EXTRA = {
63+ 'django.db.backends.postgresql_psycopg2' : {
64+ 'TEST' : {'CHARSET' : 'utf8' },
65+ },
66+ 'django.db.backends.mysql' : {
67+ 'TEST' : {'CHARSET' : 'utf8' , 'COLLATION' : 'utf8_general_ci' },
68+ },
69+ }
70+
6271#=============================================================================
6372
6473def parse_database (url ):
6574 url = urlparse (url )
66- return {
67- 'ENGINE' : ENGINES [url .scheme ],
75+ engine = ENGINES [url .scheme ]
76+ result = {
77+ 'ENGINE' : engine ,
6878 'NAME' : url .path .strip ('/' ),
6979 'HOST' : url .hostname ,
7080 'PORT' : url .port ,
7181 'USER' : url .username ,
7282 'PASSWORD' : url .password ,
73- 'CHARSET' : 'utf8' ,
74- 'COLLATION' : 'utf8_general_ci' ,
7583 }
84+ result .update (EXTRA .get (engine , {}))
85+ return result
7686
7787#=============================================================================
7888
You can’t perform that action at this time.
0 commit comments