import os import stripe from django.conf import settings from redis import StrictRedis os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true" r = StrictRedis( host=settings.REDIS_HOST, port=settings.REDIS_PORT, password=settings.REDIS_PASSWORD, db=settings.REDIS_DB ) if settings.STRIPE_TEST: stripe.api_key = settings.STRIPE_API_KEY_TEST else: stripe.api_key = settings.STRIPE_API_KEY_PROD