From 2919f5c82b12601811e224c8e989cf3005505823 Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Thu, 30 Oct 2014 12:17:47 -0400 Subject: [PATCH] More Vagrant stuff. --- accounts/views.py | 5 +++-- settings_local.py-template | 6 ++++-- utils/templatetags/intercom.py | 3 ++- views.py | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/accounts/views.py b/accounts/views.py index 2843e62..5b7b187 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.contrib.auth.decorators import login_required from annoying.decorators import ajax_request, render_to from snipts.models import Snipt @@ -18,7 +19,7 @@ def cancel_subscription(request): if request.user.profile.stripe_id is None: return {} else: - stripe.api_key = os.environ.get('STRIPE_SECRET_KEY', '') + stripe.api_key = os.environ.get('STRIPE_SECRET_KEY', settings.STRIPE_SECRET_KEY) customer = stripe.Customer.retrieve(request.user.profile.stripe_id) customer.delete() @@ -36,7 +37,7 @@ def stripe_account_details(request): if request.user.profile.stripe_id is None: return {} else: - stripe.api_key = os.environ.get('STRIPE_SECRET_KEY', '') + stripe.api_key = os.environ.get('STRIPE_SECRET_KEY', settings.STRIPE_SECRET_KEY) customer = stripe.Customer.retrieve(request.user.profile.stripe_id) data = { diff --git a/settings_local.py-template b/settings_local.py-template index 3659bfe..45efad9 100644 --- a/settings_local.py-template +++ b/settings_local.py-template @@ -1,17 +1,19 @@ AWS_ACCESS_KEY_ID = '' AWS_SECRET_ACCESS_KEY = '' AWS_STORAGE_BUCKET_NAME = '' +CSRF_COOKIE_SECURE = False DEBUG = True INTERCOM_SECRET_KEY = '' POSTMARK_API_KEY = '' -RAVEN_CONFIG_DSN = '' +RAVEN_CONFIG = { 'dsn': '' } S3_URL = 'https://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME SECRET_KEY = '' +SESSION_COOKIE_SECURE = False SSLIFY_DISABLE = True STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage' STATIC_URL = '/static/' STRIPE_SECRET_KEY = '' -USE_SSL = False +USE_HTTPS = False DATABASES = { 'default': { diff --git a/utils/templatetags/intercom.py b/utils/templatetags/intercom.py index b1bdade..8fc76c2 100644 --- a/utils/templatetags/intercom.py +++ b/utils/templatetags/intercom.py @@ -1,3 +1,4 @@ +from django.conf import settings from django import template import hmac, hashlib, os @@ -6,4 +7,4 @@ register = template.Library() @register.filter def intercom_sha_256(user_id): - return hmac.new(os.environ.get('INTERCOM_SECRET_KEY', ''), str(user_id), digestmod=hashlib.sha256).hexdigest() + return hmac.new(os.environ.get('INTERCOM_SECRET_KEY', settings.INTERCOM_SECRET_KEY), str(user_id), digestmod=hashlib.sha256).hexdigest() diff --git a/views.py b/views.py index ffb8507..c12b910 100644 --- a/views.py +++ b/views.py @@ -103,7 +103,7 @@ def pro_complete(request): if request.method == 'POST': token = request.POST['token'] - stripe.api_key = os.environ.get('STRIPE_SECRET_KEY', '') + stripe.api_key = os.environ.get('STRIPE_SECRET_KEY', settings.STRIPE_SECRET_KEY) try: customer = stripe.Customer.create(email=request.user.email,