mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 06:51:10 +03:00
Stubs for API head points. To add reverse URLs next.
This commit is contained in:
parent
620ce927a8
commit
5c7cab70b7
@ -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
|
||||
|
@ -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),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user