Add barebones toggles endpoint for development.
This commit is contained in:
@@ -144,6 +144,7 @@ urlpatterns = [
|
||||
|
||||
url(r'^api/commerce/', include(('commerce.api.urls', 'lms.djangoapps.commerce'), namespace='commerce_api')),
|
||||
url(r'^api/credit/', include('openedx.core.djangoapps.credit.urls')),
|
||||
url(r'^api/toggles/', include('openedx.core.djangoapps.waffle_utils.urls')),
|
||||
url(r'^rss_proxy/', include('rss_proxy.urls')),
|
||||
url(r'^api/organizations/', include('organizations.urls', namespace='organizations')),
|
||||
|
||||
|
||||
8
openedx/core/djangoapps/waffle_utils/urls.py
Normal file
8
openedx/core/djangoapps/waffle_utils/urls.py
Normal file
@@ -0,0 +1,8 @@
|
||||
""" URL definitions for waffle utils. """
|
||||
|
||||
from django.conf.urls import url
|
||||
from openedx.core.djangoapps.waffle_utils.views import ToggleStateView
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^state/', ToggleStateView.as_view(), name="toggle_state"),
|
||||
]
|
||||
18
openedx/core/djangoapps/waffle_utils/views.py
Normal file
18
openedx/core/djangoapps/waffle_utils/views.py
Normal file
@@ -0,0 +1,18 @@
|
||||
""" Views that we will use to view toggle state in edx-platform. """
|
||||
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
|
||||
from edx_rest_framework_extensions.permissions import IsStaff
|
||||
|
||||
from rest_framework.authentication import SessionAuthentication
|
||||
from rest_framework import permissions, views
|
||||
from rest_framework.response import Response
|
||||
|
||||
|
||||
class ToggleStateView(views.APIView):
|
||||
"""
|
||||
An endpoint for displaying the state of toggles in edx-platform.
|
||||
"""
|
||||
authentication_classes = (JwtAuthentication, SessionAuthentication,)
|
||||
permission_classes = (permissions.IsAuthenticated, IsStaff,)
|
||||
|
||||
def get(self, request):
|
||||
return Response("Hello")
|
||||
Reference in New Issue
Block a user