2023-01-15 17:59:12 +00:00
|
|
|
import os
|
|
|
|
|
2022-07-21 12:48:07 +00:00
|
|
|
import stripe
|
|
|
|
from django.conf import settings
|
2022-08-18 06:20:30 +00:00
|
|
|
from redis import StrictRedis
|
|
|
|
|
2023-01-15 17:59:12 +00:00
|
|
|
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
|
|
|
|
|
|
|
|
|
2024-12-29 17:37:23 +00:00
|
|
|
r = StrictRedis(
|
|
|
|
host=settings.REDIS_HOST,
|
|
|
|
port=settings.REDIS_PORT,
|
|
|
|
password=settings.REDIS_PASSWORD,
|
|
|
|
db=settings.REDIS_DB
|
|
|
|
)
|
2022-07-21 12:48:07 +00:00
|
|
|
|
|
|
|
if settings.STRIPE_TEST:
|
|
|
|
stripe.api_key = settings.STRIPE_API_KEY_TEST
|
|
|
|
else:
|
|
|
|
stripe.api_key = settings.STRIPE_API_KEY_PROD
|