mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 00:04:16 +03:00
Define the urlpatterns
as a list of `url()....
This commit is contained in:
parent
9f1805f2f0
commit
bfd7219352
|
@ -5,6 +5,6 @@ from .views import MockView
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
(r'^$', MockView.as_view()),
|
url(r'^$', MockView.as_view()),
|
||||||
url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
|
url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.conf.urls import url
|
||||||
from .views import MockView
|
from .views import MockView
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
(r'^$', MockView.as_view()),
|
url(r'^$', MockView.as_view()),
|
||||||
]
|
]
|
||||||
|
|
|
@ -38,11 +38,11 @@ class MockView(APIView):
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
(r'^session/$', MockView.as_view(authentication_classes=[SessionAuthentication])),
|
url(r'^session/$', MockView.as_view(authentication_classes=[SessionAuthentication])),
|
||||||
(r'^basic/$', MockView.as_view(authentication_classes=[BasicAuthentication])),
|
url(r'^basic/$', MockView.as_view(authentication_classes=[BasicAuthentication])),
|
||||||
(r'^token/$', MockView.as_view(authentication_classes=[TokenAuthentication])),
|
url(r'^token/$', MockView.as_view(authentication_classes=[TokenAuthentication])),
|
||||||
(r'^auth-token/$', 'rest_framework.authtoken.views.obtain_auth_token'),
|
url(r'^auth-token/$', 'rest_framework.authtoken.views.obtain_auth_token'),
|
||||||
url(r'^auth/', include('rest_framework.urls', namespace='rest_framework'))
|
url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
Tests for content parsing, and form-overloaded content parsing.
|
Tests for content parsing, and form-overloaded content parsing.
|
||||||
"""
|
"""
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
from django.conf.urls import url
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.contrib.auth import authenticate, login, logout
|
from django.contrib.auth import authenticate, login, logout
|
||||||
from django.contrib.sessions.middleware import SessionMiddleware
|
from django.contrib.sessions.middleware import SessionMiddleware
|
||||||
|
@ -189,7 +190,7 @@ class MockView(APIView):
|
||||||
return Response(status=status.HTTP_500_INTERNAL_SERVER_ERROR)
|
return Response(status=status.HTTP_500_INTERNAL_SERVER_ERROR)
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
(r'^$', MockView.as_view()),
|
url(r'^$', MockView.as_view()),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user