-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcommon.py
More file actions
31 lines (26 loc) · 973 Bytes
/
common.py
File metadata and controls
31 lines (26 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
Common settings for openedx_authz plugin.
"""
import os
from openedx_authz import ROOT_DIRECTORY
def plugin_settings(settings):
"""
Configure plugin settings for Open edX.
This function is called by the Open edX plugin system to configure
the Django settings for this plugin.
Args:
settings: The Django settings object
"""
# Add external third-party apps to INSTALLED_APPS
casbin_adapter_app = "openedx_authz.engine.apps.CasbinAdapterConfig"
if casbin_adapter_app not in settings.INSTALLED_APPS:
settings.INSTALLED_APPS.append(casbin_adapter_app)
# Add Casbin configuration
settings.CASBIN_MODEL = os.path.join(
ROOT_DIRECTORY, "engine", "config", "model.conf"
)
settings.CASBIN_WATCHER_ENABLED = False
# TODO: Replace with a more dynamic configuration
# Redis host and port are temporarily loaded here for the MVP
settings.REDIS_HOST = "redis"
settings.REDIS_PORT = 6379