-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from wuyue92tree/dev
Dev
- Loading branch information
Showing
7 changed files
with
156 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#! /usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
@author: wuyue | ||
@contact: [email protected] | ||
@software: IntelliJ IDEA | ||
@file: urls.py | ||
@create at: 2018-09-09 21:55 | ||
这一行开始写关于本文件的说明与解释 | ||
""" | ||
|
||
from django.urls import path, include | ||
from .views import * | ||
from rest_framework import routers | ||
# | ||
# router = routers.DefaultRouter() | ||
# router.register('profile', ProfileApiView.as_view()) | ||
|
||
urlpatterns = [ | ||
path('profile/', ProfileApiView.as_view()), | ||
path('initToken/', InitToken.as_view()), | ||
path('getToken/', GetToken.as_view()) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,5 +26,5 @@ | |
path('docs/', schema_view), | ||
|
||
# add api here | ||
|
||
path('account/', include('rest_backend.libs.accounts.urls')), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
@author: wuyue | ||
@contact: [email protected] | ||
@software: PyCharm | ||
@file: middleware.py | ||
@create at: 2018-07-28 23:05 | ||
这一行开始写关于本文件的说明与解释 | ||
""" | ||
|
||
from django.utils.deprecation import MiddlewareMixin | ||
|
||
|
||
class TokenAuthMiddleware(MiddlewareMixin): | ||
def process_request(self, request): | ||
if request.GET.get('token'): | ||
request.META['HTTP_AUTHORIZATION'] = 'Token %s' % request.GET.get( | ||
'token') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters