mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Use the MySQL connector that is recommended by Django
This commit is contained in:
@@ -3,7 +3,7 @@ FROM debian:jessie
|
|||||||
RUN apt-get update && apt-get install -y supervisor python3 git python3-pip \
|
RUN apt-get update && apt-get install -y supervisor python3 git python3-pip \
|
||||||
libxml2-dev libxslt1-dev python-dev python-virtualenv locales libffi-dev \
|
libxml2-dev libxslt1-dev python-dev python-virtualenv locales libffi-dev \
|
||||||
build-essential python3-dev zlib1g-dev libssl-dev npm gettext git \
|
build-essential python3-dev zlib1g-dev libssl-dev npm gettext git \
|
||||||
libpq-dev \
|
libpq-dev libmysqlclient-dev \
|
||||||
--no-install-recommends
|
--no-install-recommends
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|||||||
@@ -25,12 +25,9 @@ else:
|
|||||||
|
|
||||||
DEBUG = TEMPLATE_DEBUG = config.getboolean('django', 'debug', fallback=False)
|
DEBUG = TEMPLATE_DEBUG = config.getboolean('django', 'debug', fallback=False)
|
||||||
|
|
||||||
dbengine = 'django.db.backends.' + config.get('database', 'backend', fallback='sqlite3')
|
|
||||||
if dbengine == 'django.db.backends.mysql':
|
|
||||||
dbengine = 'mysql.connector.django'
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': dbengine,
|
'ENGINE': 'django.db.backends.' + config.get('database', 'backend', fallback='sqlite3'),
|
||||||
'NAME': config.get('database', 'name', fallback=os.path.join(BASE_DIR, 'db.sqlite3')),
|
'NAME': config.get('database', 'name', fallback=os.path.join(BASE_DIR, 'db.sqlite3')),
|
||||||
'USER': config.get('database', 'user', fallback=''),
|
'USER': config.get('database', 'user', fallback=''),
|
||||||
'PASSWORD': config.get('database', 'user', fallback=''),
|
'PASSWORD': config.get('database', 'user', fallback=''),
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
--allow-external mysql-connector-python
|
mysqlclient
|
||||||
mysql-connector-python
|
|
||||||
|
|||||||
Reference in New Issue
Block a user