mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-27 03:54:01 +03:00
Merge pull request #674 from ryanrdetzel/master
Fix for example in authentication.html
This commit is contained in:
commit
42aaa9cc68
|
@ -202,7 +202,7 @@ If the `.authenticate_header()` method is not overridden, the authentication sch
|
|||
The following example will authenticate any incoming request as the user given by the username in a custom request header named 'X_USERNAME'.
|
||||
|
||||
class ExampleAuthentication(authentication.BaseAuthentication):
|
||||
def has_permission(self, request, view, obj=None):
|
||||
def authenticate(self, request):
|
||||
username = request.META.get('X_USERNAME')
|
||||
if not username:
|
||||
return None
|
||||
|
|
Loading…
Reference in New Issue
Block a user