Skip to content

Instantly share code, notes, and snippets.

@AsadDevAI
Last active April 22, 2020 07:17
Show Gist options
  • Save AsadDevAI/3ef12270553dd15932becda1f683f404 to your computer and use it in GitHub Desktop.
Save AsadDevAI/3ef12270553dd15932becda1f683f404 to your computer and use it in GitHub Desktop.
Guide to enable django email service in edX locally

To Enable Django Email Service Locally:

  • First you need valid Gmail Account
  • edX installed on your local system in docker

Steps to Follow:

  1. Go to devstack.py located at lms/env/ and cms/env.
  2. Find the EMAIL_BACKEND flag and change it to 'django.core.mail.backends.smtp.EmailBackend
  3. Add few more flags:
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = '587'
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'your email address'
EMAIL_HOST_PASSWORD = 'your password'
  1. (Optional) If you are using EDX_ACE you need to change some flags in lms.env.json and cms.env.json:
"ACE_CHANNEL_TRANSACTIONAL_EMAIL": "django_email",
"ACE_CHANNEL_DEFAULT_EMAIL": "django_email",
"ACE_ENABLED_CHANNELS": [
    "django_email"
],

If above changes doesn't work then change in following file:

edx-platform/openedx/core/djangoapps/ace_common/settings/devstack.py
"""
Settings for edX ACE on devstack.
"""

from openedx.core.djangoapps.ace_common.settings import common


def plugin_settings(settings):
    """
    Override common settings and use `file_email` for better debugging.
    """
    common.plugin_settings(settings)

    settings.ACE_ENABLED_CHANNELS = [
        'django_email'
    ]

    settings.ACE_CHANNEL_DEFAULT_EMAIL = 'django_email'
    settings.ACE_CHANNEL_TRANSACTIONAL_EMAIL = 'django_email'
@iam-mhaseeb
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment