Skip to content
Snippets Groups Projects
Commit 032838b8 authored by Max Pearl's avatar Max Pearl
Browse files

Salesforce settings #2054 - env variable and settings file.

parent bac7cb95
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
node_modules/ node_modules/
/npm-debug.log /npm-debug.log
/.idea/ /.idea/
salesforce.py
# Distribution / packaging # Distribution / packaging
.Python .Python
......
...@@ -9,6 +9,7 @@ ENV DATABASE_URL postgres://hypha:hypha@db:5432/hypha ...@@ -9,6 +9,7 @@ ENV DATABASE_URL postgres://hypha:hypha@db:5432/hypha
ENV DJANGO_SETTINGS_MODULE hypha.settings.dev ENV DJANGO_SETTINGS_MODULE hypha.settings.dev
ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
ENV SALESFORCE_INTEGRATION 1
# Set owner on /usr/local. # Set owner on /usr/local.
RUN sudo chown -R circleci:circleci /usr/local RUN sudo chown -R circleci:circleci /usr/local
......
...@@ -136,6 +136,8 @@ INSTALLED_APPS = [ ...@@ -136,6 +136,8 @@ INSTALLED_APPS = [
'pagedown', 'pagedown',
'webpack_loader', 'webpack_loader',
'salesforce',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
......
...@@ -145,3 +145,11 @@ DEBUG_TOOLBAR_CONFIG = { ...@@ -145,3 +145,11 @@ DEBUG_TOOLBAR_CONFIG = {
WEBPACK_LOADER['DEFAULT'].update({ WEBPACK_LOADER['DEFAULT'].update({
'STATS_FILE': os.path.join(BASE_DIR, './hypha/static_compiled/app/webpack-stats.json'), 'STATS_FILE': os.path.join(BASE_DIR, './hypha/static_compiled/app/webpack-stats.json'),
}) })
# Salesforce Integration
if 'SALESFORCE_INTEGRATION' in env and env['SALESFORCE_INTEGRATION']:
try:
from .salesforce import *
except ImportError:
pass
DATABASES.update(SALESFORCE_DB)
...@@ -39,3 +39,11 @@ if 'SENTRY_DSN' in env: ...@@ -39,3 +39,11 @@ if 'SENTRY_DSN' in env:
if 'ON_HEROKU' in env: if 'ON_HEROKU' in env:
import django_heroku import django_heroku
django_heroku.settings(locals()) django_heroku.settings(locals())
# Salesforce Integration
if 'SALESFORCE_INTEGRATION' in env and env['SALESFORCE_INTEGRATION']:
try:
from .salesforce import *
except ImportError:
pass
DATABASES.update(SALESFORCE_DB)
SALESFORCE_DB = {
'ENGINE': 'salesforce.backend',
'CONSUMER_KEY': 'Consumer Key from Salesforce App',
'CONSUMER_SECRET': 'Consumer Secret from Salesforce APP',
'USER': 'user@email.com',
'PASSWORD': 'Password and security token concatenated',
'HOST': 'https://login.salesforce.com' # Or test or URL of salesforce org
}
SALESFORCE_QUERY_TIMEOUT = (30, 30) # (connect timeout, data timeout)
DATABASE_ROUTERS = [
"salesforce.router.ModelRouter"
]
...@@ -17,3 +17,11 @@ STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' ...@@ -17,3 +17,11 @@ STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
PASSWORD_HASHERS = [ PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher', 'django.contrib.auth.hashers.MD5PasswordHasher',
] ]
# Salesforce Integration
if 'SALESFORCE_INTEGRATION' in env and env['SALESFORCE_INTEGRATION']:
try:
from .salesforce import *
except ImportError:
pass
DATABASES.update(SALESFORCE_DB)
...@@ -41,3 +41,4 @@ tomd==0.1.3 ...@@ -41,3 +41,4 @@ tomd==0.1.3
wagtail==2.9 wagtail==2.9
wagtail-cache==1.0.0 wagtail-cache==1.0.0
whitenoise==5.1.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