File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ def INSTALLED_APPS(self): # noqa
175
175
'django_filters' ,
176
176
'polymorphic' ,
177
177
'simple_history' ,
178
+ 'djstripe' ,
178
179
179
180
# our apps
180
181
'readthedocs.projects' ,
@@ -741,9 +742,24 @@ def DOCKER_LIMITS(self):
741
742
TAGGIT_TAGS_FROM_STRING = 'readthedocs.projects.tag_utils.rtd_parse_tags'
742
743
743
744
# Stripe
745
+ # Existing values we use
744
746
STRIPE_SECRET = None
745
747
STRIPE_PUBLISHABLE = None
746
748
749
+ # DJStripe values -- **CHANGE THESE IN PRODUCTION**
750
+ STRIPE_LIVE_SECRET_KEY = None
751
+ STRIPE_TEST_SECRET_KEY = "sk_test_x" # A default so the `checks` don't fail
752
+ DJSTRIPE_WEBHOOK_SECRET = None
753
+ STRIPE_LIVE_MODE = False # Change to True in production
754
+ # This is less optimal than setting the webhook secret
755
+ # However, the app won't start without the secret
756
+ # with this setting set to the default
757
+ DJSTRIPE_WEBHOOK_VALIDATION = "retrieve_event"
758
+
759
+ # These values shouldn't need to change..
760
+ DJSTRIPE_FOREIGN_KEY_TO_FIELD = "id"
761
+ DJSTRIPE_USE_NATIVE_JSONFIELD = True # We recommend setting to True for new installations
762
+
747
763
# Do Not Track support
748
764
DO_NOT_TRACK_ENABLED = False
749
765
Original file line number Diff line number Diff line change 9
9
from django .contrib import admin
10
10
from django .views .generic .base import RedirectView , TemplateView
11
11
12
- from readthedocs .core .views import HomepageView , SupportView , do_not_track , server_error_500
12
+ from readthedocs .core .views import (
13
+ HomepageView ,
14
+ SupportView ,
15
+ do_not_track ,
16
+ server_error_500 ,
17
+ )
13
18
from readthedocs .search .api import PageSearchAPIView
14
19
from readthedocs .search .views import GlobalSearchView
15
20
51
56
re_path (r'^builds/' , include ('readthedocs.builds.urls' )),
52
57
# For testing the 500's with DEBUG on.
53
58
re_path (r'^500/$' , handler500 ),
59
+ # Put this as a unique path for the webhook, so we don't clobber existing Stripe URL's
60
+ re_path (r"^djstripe/" , include ("djstripe.urls" , namespace = "djstripe" )),
54
61
]
55
62
56
63
project_urls = [
156
163
157
164
if settings .ALLOW_ADMIN :
158
165
groups .append (admin_urls )
166
+
159
167
if settings .DEBUG :
160
168
import debug_toolbar
161
169
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ django-gravatar2==1.4.4
70
70
pytz==2022.1
71
71
django-kombu==0.9.4
72
72
stripe==2.72.0
73
+ dj-stripe==2.6.1
73
74
regex==2022.3.15
74
75
markdown==3.3.6
75
76
You can’t perform that action at this time.
0 commit comments