Expand custom Python setting section
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -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)
|
||||
==================
|
||||
|
||||
@@ -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)::
|
||||
|
||||
|
||||
@@ -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::
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user