Skip to content

Commit b60813e

Browse files
committed
APIv3: proxy these URLs to be served from El Proxito /_/api/v3/
* Related: readthedocs/addons#356 * Related: readthedocs/addons#468
1 parent 28ce3ea commit b60813e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

readthedocs/api/v3/proxied_urls.py

+3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
from readthedocs.api.v3.proxied_views import ProxiedEmbedAPI
1111
from readthedocs.search.api.v3.views import ProxiedSearchAPI
1212

13+
from .urls import router
14+
1315
api_proxied_urls = [
1416
path("embed/", ProxiedEmbedAPI.as_view(), name="embed_api_v3"),
1517
path("search/", ProxiedSearchAPI.as_view(), name="search_api_v3"),
1618
]
1719

1820
urlpatterns = api_proxied_urls
21+
urlpatterns += router.urls

readthedocs/api/v3/views.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from rest_framework.permissions import IsAuthenticated
2020
from rest_framework.renderers import BrowsableAPIRenderer
2121
from rest_framework.response import Response
22-
from rest_framework.throttling import AnonRateThrottle, UserRateThrottle
2322
from rest_framework.viewsets import GenericViewSet, ModelViewSet, ReadOnlyModelViewSet
2423
from rest_framework_extensions.mixins import NestedViewSetMixin
2524

@@ -110,7 +109,7 @@ class APIv3Settings:
110109
LimitOffsetPagination.default_limit = 10
111110

112111
renderer_classes = (AlphabeticalSortedJSONRenderer, BrowsableAPIRenderer)
113-
throttle_classes = (UserRateThrottle, AnonRateThrottle)
112+
# throttle_classes = (UserRateThrottle, AnonRateThrottle)
114113
filter_backends = (filters.DjangoFilterBackend,)
115114
metadata_class = SimpleMetadata
116115

0 commit comments

Comments
 (0)