forked from CGM_Public/pretix_original
Fixed #73 -- Add memcached configuration options
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 libmysqlclient-dev \
|
libpq-dev libmysqlclient-dev libmemcached-dev \
|
||||||
--no-install-recommends
|
--no-install-recommends
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
@@ -27,6 +27,7 @@ WORKDIR /pretix/src
|
|||||||
RUN pip3 install -r requirements.txt
|
RUN pip3 install -r requirements.txt
|
||||||
RUN pip3 install -r requirements/mysql.txt
|
RUN pip3 install -r requirements/mysql.txt
|
||||||
RUN pip3 install -r requirements/postgres.txt
|
RUN pip3 install -r requirements/postgres.txt
|
||||||
|
RUN pip3 install -r requirements/memcached.txt
|
||||||
RUN pip3 install gunicorn
|
RUN pip3 install gunicorn
|
||||||
|
|
||||||
RUN make
|
RUN make
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ Example::
|
|||||||
Connection details for the database connection. Empty by default.
|
Connection details for the database connection. Empty by default.
|
||||||
|
|
||||||
URLs
|
URLs
|
||||||
-----
|
----
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
|
||||||
@@ -161,4 +161,17 @@ Example::
|
|||||||
.. WARNING:: Never set this to ``True`` in production!
|
.. WARNING:: Never set this to ``True`` in production!
|
||||||
|
|
||||||
|
|
||||||
|
Memcached
|
||||||
|
---------
|
||||||
|
|
||||||
|
You can use an existing memcached server as pretix's caching backend::
|
||||||
|
|
||||||
|
[memcached]
|
||||||
|
location=127.0.0.1:11211
|
||||||
|
|
||||||
|
``location``
|
||||||
|
The location of memcached, either a host:port combination or a socket file.
|
||||||
|
|
||||||
|
If no memcached is configures, pretix will use Django's built-in local-memory caching method.
|
||||||
|
|
||||||
.. _Python documentation: https://docs.python.org/3/library/configparser.html?highlight=configparser#supported-ini-file-structure
|
.. _Python documentation: https://docs.python.org/3/library/configparser.html?highlight=configparser#supported-ini-file-structure
|
||||||
@@ -74,6 +74,14 @@ SESSION_COOKIE_SECURE = SESSION_COOKIE_HTTPONLY = config.getboolean(
|
|||||||
LANGUAGE_COOKIE_DOMAIN = SESSION_COOKIE_DOMAIN = CSRF_COOKIE_DOMAIN = config.get(
|
LANGUAGE_COOKIE_DOMAIN = SESSION_COOKIE_DOMAIN = CSRF_COOKIE_DOMAIN = config.get(
|
||||||
'pretix', 'cookiedomain', fallback=None)
|
'pretix', 'cookiedomain', fallback=None)
|
||||||
|
|
||||||
|
if config.has_option('memcached', 'location'):
|
||||||
|
CACHES = {
|
||||||
|
'default': {
|
||||||
|
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
|
||||||
|
'LOCATION': config.get('memcached', 'location'),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Internal settings
|
# Internal settings
|
||||||
|
|
||||||
STATIC_ROOT = '_static'
|
STATIC_ROOT = '_static'
|
||||||
|
|||||||
1
src/requirements/memcached.txt
Normal file
1
src/requirements/memcached.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pylibmc
|
||||||
Reference in New Issue
Block a user