Skip to content

Commit

Permalink
Don’t bundle together AWS/SENDGRID/SENTRY
Browse files Browse the repository at this point in the history
  • Loading branch information
jscott1989 committed Mar 29, 2017
1 parent 4f6826b commit baa154a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 5 additions & 1 deletion src/env
Expand Up @@ -2,12 +2,16 @@

DATABASE_URL=postgres://happeningdev:happeningdev@localhost:5432/happeningdev

# These are not required in development
# SENDGRID
SENDGRID_USERNAME=""
SENDGRID_PASSWORD=""

# AWS
AWS_ACCESS_KEY_ID=""
AWS_SECRET_ACCESS_KEY=""
S3_BUCKET_NAME=""

# SENTRY
SENTRY_DSN=""

# These should be disabled in production
Expand Down
2 changes: 1 addition & 1 deletion src/happening/celery.py
Expand Up @@ -23,7 +23,7 @@ class Celery(celery.Celery):

def on_configure(self):
"""Override so we can log to sentry."""
if settings.USE_LIVE_DATA:
if settings.SENTRY_DSN:
client = raven.Client(settings.SENTRY_DSN)

# register a custom filter to filter out duplicate logs
Expand Down
11 changes: 5 additions & 6 deletions src/happening/settings.py
Expand Up @@ -27,7 +27,6 @@
'HAPPENING_TESTING' in os.environ
USE_DEBUG_TOOLBAR = DEBUG and (bool(os.environ.get('USE_DEBUG_TOOLBAR',
'False') == 'True'))
USE_LIVE_DATA = bool(os.environ.get('USE_LIVE_DATA', str(not DEBUG)) == 'True')
DISABLE_SSL = bool(os.environ.get('DISABLE_SSL', 'False') == 'True') or \
'HAPPENING_TESTING' in os.environ

Expand Down Expand Up @@ -216,9 +215,9 @@
ACCOUNT_ADAPTER = 'members.allauth_config.AccountAdapter'
ACCOUNT_EMAIL_REQUIRED = True

if not USE_LIVE_DATA:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
else:

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
if os.environ.get('SENDGRID_USERNAME'):
# Using SENDGRID
EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = os.environ.get('SENDGRID_USERNAME', '')
Expand All @@ -227,7 +226,7 @@
EMAIL_USE_TLS = True

# AWS
if USE_LIVE_DATA:
if os.environ.get('AWS_ACCESS_KEY_ID'):
AWS_QUERYSTRING_AUTH = False
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
Expand All @@ -238,7 +237,7 @@
SENTRY_DSN = os.environ.get('SENTRY_DSN')

# Sentry error tracking
if USE_LIVE_DATA:
if SENTRY_DSN:
# Set your DSN value
RAVEN_CONFIG = {
'dsn': SENTRY_DSN,
Expand Down
11 changes: 4 additions & 7 deletions src/requirements.txt
Expand Up @@ -20,15 +20,12 @@ django-filter==1.0.1
django-wkhtmltopdf==3.1.0
django-ordered-model==1.3.0
django-guardian==1.4.6


# Heroku
gunicorn==19.7.1 # For hosting on heroku
dj-database-url==0.4.2 # Heroku databases
gunicorn==19.7.1 # For hosting
dj-database-url==0.4.2 # databases
dj-static==0.0.6 # Static files
psycopg2==2.7.1 # Postgres driver
django-storages==1.5.2 # Media storage on AWS
boto==2.46.1 # Media storage on AWS
django-storages==1.5.2 # Media storage
boto==2.46.1 # AWS Media storage

# Authentication

Expand Down

0 comments on commit baa154a

Please sign in to comment.