Cleanups.
This commit is contained in:
@@ -4,8 +4,6 @@ from django.conf.urls import include, patterns, url
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils.module_loading import import_string
|
from django.utils.module_loading import import_string
|
||||||
|
|
||||||
from rest_framework.reverse import reverse
|
|
||||||
|
|
||||||
|
|
||||||
class APIEndPoint(object):
|
class APIEndPoint(object):
|
||||||
_registry = {}
|
_registry = {}
|
||||||
@@ -30,7 +28,7 @@ class APIEndPoint(object):
|
|||||||
api_urls = import_string(
|
api_urls = import_string(
|
||||||
'{0}.urls.api_urls'.format(app.name)
|
'{0}.urls.api_urls'.format(app.name)
|
||||||
)
|
)
|
||||||
except Exception as exception:
|
except Exception:
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from navigation import Link
|
|||||||
|
|
||||||
link_api = Link(
|
link_api = Link(
|
||||||
icon='fa fa-plug', tags='new_window', text=_('REST API'),
|
icon='fa fa-plug', tags='new_window', text=_('REST API'),
|
||||||
view='rest_api:api-root'
|
view='rest_api:api_root'
|
||||||
)
|
)
|
||||||
link_api_documentation = Link(
|
link_api_documentation = Link(
|
||||||
icon='fa fa-book', tags='new_window', text=_('API Documentation'),
|
icon='fa fa-book', tags='new_window', text=_('API Documentation'),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.conf.urls import include, patterns, url
|
from django.conf.urls import patterns, url
|
||||||
|
|
||||||
from .views import APIBase, APIAppView, BrowseableObtainAuthToken
|
from .views import APIBase, APIAppView, BrowseableObtainAuthToken
|
||||||
|
|
||||||
@@ -11,8 +11,8 @@ urlpatterns = patterns(
|
|||||||
|
|
||||||
api_urls = patterns(
|
api_urls = patterns(
|
||||||
'',
|
'',
|
||||||
url(r'^$', APIBase.as_view(), name='api-root'),
|
url(r'^$', APIBase.as_view(), name='api_root'),
|
||||||
url(r'^api/(?P<path>.*)/?$', APIAppView.as_view(), name='api-app'),
|
url(r'^api/(?P<path>.*)/?$', APIAppView.as_view(), name='api_app'),
|
||||||
url(
|
url(
|
||||||
r'^auth/token/obtain/$', BrowseableObtainAuthToken.as_view(),
|
r'^auth/token/obtain/$', BrowseableObtainAuthToken.as_view(),
|
||||||
name='auth_token_obtain'
|
name='auth_token_obtain'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from rest_framework import generics, renderers
|
from rest_framework import renderers
|
||||||
from rest_framework.authtoken.views import ObtainAuthToken
|
from rest_framework.authtoken.views import ObtainAuthToken
|
||||||
from rest_framework_swagger.views import SwaggerApiView, SwaggerResourcesView
|
from rest_framework_swagger.views import SwaggerApiView, SwaggerResourcesView
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user