Skip to content

Commit

Permalink
Add obtain_jwt_token shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
jpadilla committed Sep 1, 2014
1 parent de5a5a7 commit 65cdbf8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions jwt_auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ def render_bad_request_response(self, error_dict=None):

return HttpResponseBadRequest(
json_context, content_type='application/json')


obtain_jwt_token = ObtainJSONWebToken.as_view()
4 changes: 1 addition & 3 deletions tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from django.conf.urls import patterns

from jwt_auth.views import ObtainJSONWebToken

from tests.views import MockView


urlpatterns = patterns(
'',
(r'^jwt/$', MockView.as_view()),
(r'^auth-token/$', ObtainJSONWebToken.as_view()),
(r'^auth-token/$', 'jwt_auth.views.obtain_jwt_token'),
)

0 comments on commit 65cdbf8

Please sign in to comment.