Skip to content
Snippets Groups Projects
Unverified Commit 740a40d1 authored by Max Pearl's avatar Max Pearl Committed by GitHub
Browse files

Merge pull request #2056 from maxpearl/feature/salesforce-integration

Feature/salesforce integration
parents fe81a1f8 f2c7fa08
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@
node_modules/
/npm-debug.log
/.idea/
salesforce.env
# Distribution / packaging
.Python
......
......@@ -10,6 +10,9 @@ ENV DJANGO_SETTINGS_MODULE hypha.settings.dev
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Salesforce Integration
ENV SALESFORCE_INTEGRATION 1
# Set owner on /usr/local.
RUN sudo chown -R circleci:circleci /usr/local
......
......@@ -18,6 +18,8 @@ services:
build:
context: ..
dockerfile: docker/Dockerfile.dev
env_file:
- salesforce.env
ports:
- 9001:9001
volumes:
......
......@@ -136,6 +136,8 @@ INSTALLED_APPS = [
'pagedown',
'webpack_loader',
'salesforce',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
......@@ -201,12 +203,34 @@ WSGI_APPLICATION = 'hypha.wsgi.application'
# Database
# https://docs.djangoproject.com/en/stable/ref/settings/#databases
DATABASES = {
'default': dj_database_url.config(
conn_max_age=600,
default=f"postgres:///{APP_NAME}"
)
}
if 'SALESFORCE_INTEGRATION' in env and env['SALESFORCE_INTEGRATION']:
DATABASES = {
'default': dj_database_url.config(
conn_max_age=600,
default=f"postgres:///{APP_NAME}"
),
'salesforce': {
'ENGINE': 'salesforce.backend',
'CONSUMER_KEY': env['CONSUMER_KEY'],
'CONSUMER_SECRET': env['CONSUMER_SECRET'],
'USER': env['SALESFORCE_USER'],
'PASSWORD': env['SALESFORCE_PASSWORD'],
'HOST': env['SALESFORCE_LOGIN_URL']
}
}
SALESFORCE_QUERY_TIMEOUT = (30, 30) # (connect timeout, data timeout)
DATABASE_ROUTERS = [
"salesforce.router.ModelRouter"
]
else:
DATABASES = {
'default': dj_database_url.config(
conn_max_age=600,
default=f"postgres:///{APP_NAME}"
)
}
# Cache
......
......@@ -41,3 +41,4 @@ tomd==0.1.3
wagtail==2.9
wagtail-cache==1.0.0
whitenoise==5.1.0
django-salesforce==1.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment