diff --git a/HISTORY.rst b/HISTORY.rst index b86dddb48a..f0f0436acf 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -26,6 +26,7 @@ - Automate paths in documentation. - Settings chapter improvements. - Documentation paths consistency fixes. +- Expand custom Python setting section. 3.2.9 (2019-11-03) ================== diff --git a/docs/chapters/deploying.rst b/docs/chapters/deploying.rst index 2533d1ca90..5c9abe4ebb 100644 --- a/docs/chapters/deploying.rst +++ b/docs/chapters/deploying.rst @@ -146,14 +146,14 @@ For another setup that offers more performance and scalability refer to the |MAYAN_BIN| preparestatic --noinput -11. Create the supervisor file at ``/etc/supervisor/conf.d/mayan.conf``: +11. Create the supervisor file at ``|MAYAN_SUPERVISOR_CONF|``: ------------------------------------------------------------------------ :: sudo MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan \ MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan \ MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| \ - |MAYAN_BIN| platformtemplate supervisord > /etc/supervisor/conf.d/mayan.conf + |MAYAN_BIN| platformtemplate supervisord > |MAYAN_SUPERVISOR_CONF| 12. Configure Redis: @@ -220,7 +220,7 @@ of a restart or power failure. The Gunicorn workers are increased to 3. sudo rabbitmqctl set_permissions -p mayan mayan ".*" ".*" ".*" -4. Edit the supervisor file at ``/etc/supervisor/conf.d/mayan.conf``: +4. Edit the supervisor file at ``|MAYAN_SUPERVISOR_CONF|``: --------------------------------------------------------------------- Replace (paying attention to the comma at the end):: diff --git a/docs/chapters/settings.rst b/docs/chapters/settings.rst index 222fb34927..0af74302b5 100644 --- a/docs/chapters/settings.rst +++ b/docs/chapters/settings.rst @@ -108,6 +108,17 @@ or via the ``DJANGO_SETTINGS_MODULE`` environment variable like this:: export DJANGO_SETTINGS_MODULE=mayan.media.mayan_settings.mysettings +To make the use of the custom Python setting file permanent, update the ``|MAYAN_SUPERVISOR_CONF|`` +file. In the ``[supervisord]`` section, update the ``environment=`` value of +``DJANGO_SETTINGS_MODULE`` from the default ``mayan.settings.production`` to +``mayan.media.mayan_settings.mysettings``. Pay attention to the indentation of +the ``environment=`` entries. + +Force supervisor to read the changes and restart using:: + + sudo supervisorctl reread + sudo supervisorctl restart all + For the :doc:`../chapters/docker` installation method, the full import path will be ``mayan_settings.mysettings`` and can only be passed via the ``MAYAN_SETTINGS_MODULE`` environment variable like this:: diff --git a/docs/conf.py b/docs/conf.py index 95d8875080..8b7eda9633 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -273,6 +273,8 @@ def setup(app): MAYAN_GUNICORN_BIN = os.path.join(MAYAN_PYTHON_BIN_DIR, 'gunicorn') MAYAN_PIP_BIN = os.path.join(MAYAN_PYTHON_BIN_DIR, 'pip') MAYAN_BIN = os.path.join(MAYAN_PYTHON_BIN_DIR, 'mayan-edms.py') + SUPERVISOR_ETC_PATH = '/etc/supervisor/conf.d/' + MAYAN_SUPERVISOR_CONF = os.path.join(SUPERVISOR_ETC_PATH, 'mayan.conf') environment_variables = utils.load_env_file() environment_variables['DOCKER_MAYAN_IMAGE_VERSION'] = mayan.__version__ @@ -280,8 +282,10 @@ def setup(app): environment_variables['MAYAN_MEDIA_ROOT'] = MAYAN_MEDIA_ROOT environment_variables['MAYAN_PYTHON_BIN_DIR'] = MAYAN_PYTHON_BIN_DIR environment_variables['MAYAN_GUNICORN_BIN'] = MAYAN_GUNICORN_BIN - environment_variables['MAYAN_PIP_BIN'] = MAYAN_PIP_BIN environment_variables['MAYAN_BIN'] = MAYAN_BIN + environment_variables['MAYAN_PIP_BIN'] = MAYAN_PIP_BIN + environment_variables['SUPERVISOR_ETC_PATH'] = SUPERVISOR_ETC_PATH + environment_variables['MAYAN_SUPERVISOR_CONF'] = MAYAN_SUPERVISOR_CONF substitutions = utils.generate_substitutions( dictionary=environment_variables ) diff --git a/docs/releases/3.2.10.rst b/docs/releases/3.2.10.rst index 37984ab20e..a017f5089c 100644 --- a/docs/releases/3.2.10.rst +++ b/docs/releases/3.2.10.rst @@ -60,7 +60,7 @@ Perform these steps after updating the code from either step above. Make a backup of your supervisord file:: - sudo cp /etc/supervisor/conf.d/mayan.conf /etc/supervisor/conf.d/mayan.conf.bck + sudo cp |MAYAN_SUPERVISOR_CONF| |MAYAN_SUPERVISOR_CONF|.bck Update the supervisord configuration file. Replace the environment variables values show here with your respective settings. This step will refresh @@ -70,12 +70,12 @@ recommended layout:: sudo MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan \ MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan \ MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| \ - |MAYAN_BIN| platformtemplate supervisord > /etc/supervisor/conf.d/mayan.conf + |MAYAN_BIN| platformtemplate supervisord > |MAYAN_SUPERVISOR_CONF| Edit the supervisord configuration file and update any setting the template generator missed:: - sudo vi /etc/supervisor/conf.d/mayan.conf + sudo vi |MAYAN_SUPERVISOR_CONF| Migrate existing database schema with::