diff --git a/lib/main/views.py b/lib/main/views.py index 8a1dbea609..b2dab5862e 100644 --- a/lib/main/views.py +++ b/lib/main/views.py @@ -28,10 +28,27 @@ from rest_framework.response import Response from rest_framework import status from rest_framework.settings import api_settings from rest_framework.authtoken.views import ObtainAuthToken +from rest_framework.views import APIView import exceptions import datetime +import json as python_json from base_views import * + +class ApiRootView(APIView): + + def get(self, request, format=None): + data = {} + #data = python_json.dumps(data) + return Response(data) + +class ApiV1RootView(APIView): + + def get(self, request, format=None): + data = {} + #data = python_json.dumps(data) + return Response(data) + class AuthTokenView(ObtainAuthToken): renderer_classes = api_settings.DEFAULT_RENDERER_CLASSES diff --git a/lib/urls.py b/lib/urls.py index 9b595d6439..ef3a873b0c 100644 --- a/lib/urls.py +++ b/lib/urls.py @@ -18,6 +18,9 @@ from django.conf import settings from django.conf.urls import * import lib.main.views as views +views_ApiRootView = views.ApiRootView.as_view() +views_ApiV1RootView = views.ApiV1RootView.as_view() + # auth token views_AuthTokenView = views.AuthTokenView.as_view() @@ -102,6 +105,9 @@ views_CredentialsDetail = views.CredentialsDetail.as_view() urlpatterns = patterns('', + url(r'^api/$', views_ApiRootView), + url(r'^api/v1/$', views_ApiV1RootView), + # obtain auth token url(r'^api/v1/authtoken/$', views_AuthTokenView),