2020-05-18 09:24:09 +00:00
|
|
|
.. _plugins_examples:
|
|
|
|
|
2022-02-07 17:11:43 +00:00
|
|
|
========
|
|
|
|
Examples
|
|
|
|
========
|
2020-05-18 09:24:09 +00:00
|
|
|
|
|
|
|
The following are simple examples of :ref:`Tutor plugins <plugins>` that can be used to modify the behaviour of Open edX.
|
|
|
|
|
|
|
|
Skip email validation for new users
|
2022-02-07 17:11:43 +00:00
|
|
|
===================================
|
2020-05-18 09:24:09 +00:00
|
|
|
|
|
|
|
::
|
|
|
|
|
2022-02-07 17:11:43 +00:00
|
|
|
from tutor import hooks
|
|
|
|
|
|
|
|
hooks.Filters.ENV_PATCHES.add_item(
|
|
|
|
(
|
|
|
|
"common-env-features",
|
|
|
|
"""
|
|
|
|
"SKIP_EMAIL_VALIDATION": true
|
|
|
|
""""
|
|
|
|
)
|
|
|
|
)
|
2020-10-06 07:56:51 +00:00
|
|
|
|
2020-05-18 09:24:09 +00:00
|
|
|
Enable bulk enrollment view in the LMS
|
2022-02-07 17:11:43 +00:00
|
|
|
======================================
|
2020-05-18 09:24:09 +00:00
|
|
|
|
|
|
|
::
|
|
|
|
|
2022-02-07 17:11:43 +00:00
|
|
|
from tutor import hooks
|
|
|
|
|
|
|
|
hooks.Filters.ENV_PATCHES.add_item(
|
|
|
|
(
|
|
|
|
"lms-env-features",
|
|
|
|
"""
|
|
|
|
"ENABLE_BULK_ENROLLMENT_VIEW": true
|
|
|
|
"""
|
|
|
|
)
|
|
|
|
)
|
2020-05-18 09:24:09 +00:00
|
|
|
|
|
|
|
Enable Google Analytics
|
2022-02-07 17:11:43 +00:00
|
|
|
=======================
|
2020-05-18 09:24:09 +00:00
|
|
|
|
|
|
|
::
|
|
|
|
|
2022-02-07 17:11:43 +00:00
|
|
|
from tutor import hooks
|
|
|
|
|
|
|
|
hooks.Filters.ENV_PATCHES.add_item(
|
|
|
|
(
|
|
|
|
"openedx-common-settings",
|
|
|
|
"""
|
|
|
|
# googleanalytics special settings
|
|
|
|
GOOGLE_ANALYTICS_ACCOUNT = "UA-your-account"
|
|
|
|
GOOGLE_ANALYTICS_TRACKING_ID = "UA-your-tracking-id"
|
|
|
|
"""
|
|
|
|
)
|
|
|
|
)
|
2020-05-18 09:24:09 +00:00
|
|
|
|
|
|
|
Enable SAML authentication
|
2022-02-07 17:11:43 +00:00
|
|
|
==========================
|
2020-05-18 09:24:09 +00:00
|
|
|
|
|
|
|
::
|
|
|
|
|
2022-02-07 17:11:43 +00:00
|
|
|
from tutor import hooks
|
|
|
|
|
|
|
|
hooks.Filters.ENV_PATCHES.add_items([
|
|
|
|
(
|
|
|
|
"common-env-features",
|
|
|
|
'"ENABLE_THIRD_PARTY_AUTH": true',
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"openedx-lms-common-settings:",
|
|
|
|
"""
|
|
|
|
# saml special settings
|
|
|
|
AUTHENTICATION_BACKENDS += ["common.djangoapps.third_party_auth.saml.SAMLAuthBackend", "django.contrib.auth.backends.ModelBackend"]
|
|
|
|
"""
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"openedx-auth",
|
|
|
|
"""
|
|
|
|
"SOCIAL_AUTH_SAML_SP_PRIVATE_KEY": "yoursecretkey",
|
|
|
|
"SOCIAL_AUTH_SAML_SP_PUBLIC_CERT": "yourpubliccert"
|
|
|
|
"""
|
|
|
|
),
|
|
|
|
])
|
2020-05-18 09:24:09 +00:00
|
|
|
|
|
|
|
Do not forget to replace "yoursecretkey" and "yourpubliccert" with your own values.
|