Skip to content

Commit

Permalink
adds features to run livedemo
Browse files Browse the repository at this point in the history
  • Loading branch information
smirolo committed Mar 15, 2024
1 parent 9b70461 commit 29ad672
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion djaoapp/notifications/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _load_backend(path):


def send_notification(event_name, context=None, site=None, recipients=None):
backends = getattr(sys.modules[__name__], '_NOTIFICATION_BACKENDS')
backends = getattr(sys.modules[__name__], '_NOTIFICATION_BACKENDS', None)
if backends is None:
backends = OrderedDict()
for backend_path in settings.NOTIFICATION_BACKENDS:
Expand Down
10 changes: 9 additions & 1 deletion djaoapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@
DB_USER = None
DB_PASSWORD = None

SEND_EMAIL = True
DISABLED_USER_UPDATE = False

MULTITIER_SITE_MODEL = None
RULES_ENC_KEY_OVERRIDE = None
RULES_ENTRY_POINT_OVERRIDE = None

SEND_EMAIL = True

#pylint: disable=undefined-variable
STRIPE_MODE = 0 # ``LOCAL``, i.e. defaults to storing customers and charges
Expand Down Expand Up @@ -723,6 +728,8 @@ def theme_dir(account):
'ACCOUNT_MODEL': 'saas.Organization',
'DEFAULT_APP_CALLABLE': 'djaoapp.thread_locals.djaoapp_get_current_app',
'DEFAULT_RULES': [('/app/', 1, False), ('/', 0, False)],
'ENC_KEY_OVERRIDE': RULES_ENC_KEY_OVERRIDE,
'ENTRY_POINT_OVERRIDE': RULES_ENTRY_POINT_OVERRIDE,
'EXTRA_MIXIN': djaoapp.extras.rules.ExtraMixin,
'RULE_OPERATORS': (
'', # 0
Expand Down Expand Up @@ -782,6 +789,7 @@ def theme_dir(account):
'djaoapp.thread_locals.get_disabled_authentication',
'DISABLED_REGISTRATION':
'djaoapp.thread_locals.get_disabled_registration',
'DISABLED_USER_UPDATE': DISABLED_USER_UPDATE,
'EMAIL_DYNAMIC_VALIDATOR': getattr(
sys.modules[__name__], 'SIGNUP_EMAIL_DYNAMIC_VALIDATOR', None),
'EMAIL_VERIFICATION_BACKEND':
Expand Down
13 changes: 12 additions & 1 deletion etc/site.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ DB_NAME = "%(DB_FILENAME)s"
#DB_ENGINE = "postgresql"
#DB_NAME = "%(DB_NAME)s"

SEARCH_INDEXES_ROOT = "%(LOCALSTATEDIR)s/whoosh"
# Overrides the entry_point and encoding key to forward HTTP requests to
# (initially implemented for livedemo)
RULES_ENC_KEY_OVERRIDE = ""
RULES_ENTRY_POINT_OVERRIDE = ""

CELERY_BROKER_URL = "redis://localhost:6379/0"
SEARCH_INDEXES_ROOT = "%(LOCALSTATEDIR)s/whoosh"

# Mail server and accounts for notifications.
# Host, port, TLS for sending email.
Expand Down Expand Up @@ -53,6 +58,12 @@ ADMINS = ( ('Support Team', '%(ADMIN_EMAIL)s'), )
STRIPE_CONNECT_CALLBACK_URL = ""
STRIPE_TEST_CONNECT_CALLBACK_URL = ""

# Authentication settings
# -----------------------

# Disable update to user credentials (livedemo)
DISABLED_USER_UPDATE = False

# Bots prevention
LOGIN_THROTTLE = None
PASSWORD_RESET_THROTTLE = None
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ djangorestframework==3.14.0 # 3.13.1 is last version supporting Django 2.2
djaodjin-deployutils==0.10.9
djaodjin-extended-templates==0.4.6
djaodjin-multitier==0.2.1
djaodjin-rules==0.4.4
djaodjin-rules==0.4.5
djaodjin-saas==0.20.1
djaodjin-signup==0.9.4
djaodjin-signup==0.9.5
docutils==0.15.2 # botocore has a constraint: docutils<0.16
googlemaps==4.10.0
# gunicorn 19.0 is broken (see issue 787)
Expand Down

0 comments on commit 29ad672

Please sign in to comment.