diff --git a/CHANGELOG.md b/CHANGELOG.md index 4932c85..128c025 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ Note: Breaking changes between versions are indicated by "💥". ## Unreleased +- [Bugfix] Fix django setting value and static asset loading in openedx-dev image + ## v11.1.1 (2021-01-20) - [Feature] Add a `tutor images build --target=...` argument for [multi-stage Docker builds](https://docs.docker.com/develop/develop-images/multistage-build/). diff --git a/docs/dev.rst b/docs/dev.rst index 9c19aed..eb1f618 100644 --- a/docs/dev.rst +++ b/docs/dev.rst @@ -217,7 +217,7 @@ Custom edx-platform settings By default, tutor settings files are mounted inside the docker images at ``/openedx/edx-platform/lms/envs/tutor/`` and ``/openedx/edx-platform/cms/envs/tutor/``. In the various ``dev`` commands, the default ``edx-platform`` settings module is set to ``tutor.development`` and you don't have to do anything to set up these settings. -If, for some reason, you want to use different settings, you will need to pass the ``-e SETTINGS=mycustomsettings`` option to each command. Alternatively, you can define the ``TUTOR_EDX_PLATFORM_SETTINGS`` environment variable. +If, for some reason, you want to use different settings, you will need to define the ``TUTOR_EDX_PLATFORM_SETTINGS`` environment variable. For instance, let's assume you have created the ``/path/to/edx-platform/lms/envs/mysettings.py`` and ``/path/to/edx-platform/cms/envs/mysettings.py`` modules. These settings should be pretty similar to the following files:: diff --git a/docs/local.rst b/docs/local.rst index eccc391..5ff0091 100644 --- a/docs/local.rst +++ b/docs/local.rst @@ -225,7 +225,7 @@ Loading different production settings for ``edx-platform`` The default settings module loaded by ``edx-platform`` is ``tutor.production``. The folders ``$(tutor config printroot)/env/apps/openedx/settings/lms`` and ``$(tutor config printroot)/env/apps/openedx/settings/cms`` are mounted as ``edx-platform/lms/envs/tutor`` and ``edx-platform/cms/envs/tutor`` inside the docker containers. Thus, to use your own settings, you must do two things: 1. Copy your settings files for the lms and the cms to ``$(tutor config printroot)/env/apps/openedx/settings/lms/mysettings.py`` and ``$(tutor config printroot)/env/apps/openedx/settings/cms/mysettings.py``. -2. Load your settings by adding ``EDX_PLATFORM_SETTINGS=tutor.mysettings`` to ``$(tutor config printroot)/env/local/.env``. +2. Load your settings by adding ``TUTOR_EDX_PLATFORM_SETTINGS=tutor.mysettings`` to ``$(tutor config printroot)/env/local/.env``. Of course, your settings should be compatible with the docker installation. You can get some inspiration from the ``production.py`` settings modules generated by Tutor, or just import it as a base by adding ``from .production import *`` at the top of ``mysettings.py``. diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index 7cbe8d9..a2d73e5 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -104,7 +104,7 @@ The error produced should help you better understand what is happening. ValueError: Unable to configure handler 'local': [Errno 2] No such file or directory -This will occur if you try to run a development environment without patching the LOGGING configuration, as indicated in the `development_` section. Maybe you correctly patched the development settings, but they are not taken into account? For instance, you might have correctly defined the ``EDX_PLATFORM_SETTINGS`` environment variable, but ``paver`` uses the ``devstack`` settings (which does not patch the ``LOGGING`` variable). This is because calling ``paver lms --settings=development`` or ``paver cms --settings=development`` ignores the ``--settings`` argument. Yes, it might be considered an edx-platform bug... Instead, you should run the ``update_assets`` and ``runserver`` commands, as explained above. +This will occur if you try to run a development environment without patching the LOGGING configuration, as indicated in the `development_` section. Maybe you correctly patched the development settings, but they are not taken into account? For instance, you might have correctly defined the ``TUTOR_EDX_PLATFORM_SETTINGS`` environment variable, but ``paver`` uses the ``devstack`` settings (which does not patch the ``LOGGING`` variable). This is because calling ``paver lms --settings=development`` or ``paver cms --settings=development`` ignores the ``--settings`` argument. Yes, it might be considered an edx-platform bug... Instead, you should run the ``update_assets`` and ``runserver`` commands, as explained above. The chosen default language does not display properly ----------------------------------------------------- diff --git a/tutor/templates/dev/docker-compose.yml b/tutor/templates/dev/docker-compose.yml index a8d5b6a..ee65403 100644 --- a/tutor/templates/dev/docker-compose.yml +++ b/tutor/templates/dev/docker-compose.yml @@ -3,6 +3,8 @@ version: "3.7" x-openedx-service: &openedx-service image: {{ DOCKER_IMAGE_OPENEDX_DEV }} + environment: + SETTINGS: ${TUTOR_EDX_PLATFORM_SETTINGS:-tutor.development} volumes: # Settings & config - ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/:ro diff --git a/tutor/templates/local/docker-compose.jobs.yml b/tutor/templates/local/docker-compose.jobs.yml index 9546a31..b7a5eeb 100644 --- a/tutor/templates/local/docker-compose.jobs.yml +++ b/tutor/templates/local/docker-compose.jobs.yml @@ -11,7 +11,7 @@ services: image: {{ DOCKER_IMAGE_OPENEDX }} environment: SERVICE_VARIANT: lms - SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production} + SETTINGS: ${TUTOR_EDX_PLATFORM_SETTINGS:-tutor.production} volumes: - ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/:ro - ../apps/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/:ro @@ -22,7 +22,7 @@ services: image: {{ DOCKER_IMAGE_OPENEDX }} environment: SERVICE_VARIANT: cms - SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production} + SETTINGS: ${TUTOR_EDX_PLATFORM_SETTINGS:-tutor.production} volumes: - ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/:ro - ../apps/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/:ro diff --git a/tutor/templates/local/docker-compose.yml b/tutor/templates/local/docker-compose.yml index 1d0de01..71d6bd7 100644 --- a/tutor/templates/local/docker-compose.yml +++ b/tutor/templates/local/docker-compose.yml @@ -75,7 +75,7 @@ services: environment: SERVICE_VARIANT: lms UWSGI_WORKERS: {{ OPENEDX_LMS_UWSGI_WORKERS }} - SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production} + SETTINGS: ${TUTOR_EDX_PLATFORM_SETTINGS:-tutor.production} restart: unless-stopped volumes: - ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/:ro @@ -99,7 +99,7 @@ services: environment: SERVICE_VARIANT: cms UWSGI_WORKERS: {{ OPENEDX_CMS_UWSGI_WORKERS }} - SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production} + SETTINGS: ${TUTOR_EDX_PLATFORM_SETTINGS:-tutor.production} restart: unless-stopped volumes: - ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/:ro @@ -124,7 +124,7 @@ services: image: {{ DOCKER_IMAGE_OPENEDX }} environment: SERVICE_VARIANT: lms - SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production} + SETTINGS: ${TUTOR_EDX_PLATFORM_SETTINGS:-tutor.production} C_FORCE_ROOT: "1" # run celery tasks as root #nofear command: celery worker --app=cms.celery --loglevel=info --hostname=edx.lms.core.default.%%h --maxtasksperchild 100 --exclude-queues=edx.cms.core.default restart: unless-stopped @@ -143,7 +143,7 @@ services: image: {{ DOCKER_IMAGE_OPENEDX }} environment: SERVICE_VARIANT: cms - SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production} + SETTINGS: ${TUTOR_EDX_PLATFORM_SETTINGS:-tutor.production} C_FORCE_ROOT: "1" # run celery tasks as root #nofear command: celery worker --app=cms.celery --loglevel=info --hostname=edx.cms.core.default.%%h --maxtasksperchild 100 --exclude-queues=edx.lms.core.default restart: unless-stopped