More Vagrant stuff.

master
Nick Sergeant 2014-10-30 12:17:47 -04:00
parent c6443c9ae9
commit 2919f5c82b
4 changed files with 10 additions and 6 deletions

View File

@ -1,3 +1,4 @@
from django.conf import settings
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from annoying.decorators import ajax_request, render_to from annoying.decorators import ajax_request, render_to
from snipts.models import Snipt from snipts.models import Snipt
@ -18,7 +19,7 @@ def cancel_subscription(request):
if request.user.profile.stripe_id is None: if request.user.profile.stripe_id is None:
return {} return {}
else: 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 = stripe.Customer.retrieve(request.user.profile.stripe_id)
customer.delete() customer.delete()
@ -36,7 +37,7 @@ def stripe_account_details(request):
if request.user.profile.stripe_id is None: if request.user.profile.stripe_id is None:
return {} return {}
else: 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 = stripe.Customer.retrieve(request.user.profile.stripe_id)
data = { data = {

View File

@ -1,17 +1,19 @@
AWS_ACCESS_KEY_ID = '' AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = '' AWS_SECRET_ACCESS_KEY = ''
AWS_STORAGE_BUCKET_NAME = '' AWS_STORAGE_BUCKET_NAME = ''
CSRF_COOKIE_SECURE = False
DEBUG = True DEBUG = True
INTERCOM_SECRET_KEY = '' INTERCOM_SECRET_KEY = ''
POSTMARK_API_KEY = '' POSTMARK_API_KEY = ''
RAVEN_CONFIG_DSN = '' RAVEN_CONFIG = { 'dsn': '' }
S3_URL = 'https://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME S3_URL = 'https://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
SECRET_KEY = '' SECRET_KEY = ''
SESSION_COOKIE_SECURE = False
SSLIFY_DISABLE = True SSLIFY_DISABLE = True
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage' STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
STATIC_URL = '/static/' STATIC_URL = '/static/'
STRIPE_SECRET_KEY = '' STRIPE_SECRET_KEY = ''
USE_SSL = False USE_HTTPS = False
DATABASES = { DATABASES = {
'default': { 'default': {

View File

@ -1,3 +1,4 @@
from django.conf import settings
from django import template from django import template
import hmac, hashlib, os import hmac, hashlib, os
@ -6,4 +7,4 @@ register = template.Library()
@register.filter @register.filter
def intercom_sha_256(user_id): 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()

View File

@ -103,7 +103,7 @@ def pro_complete(request):
if request.method == 'POST': if request.method == 'POST':
token = request.POST['token'] 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: try:
customer = stripe.Customer.create(email=request.user.email, customer = stripe.Customer.create(email=request.user.email,