python 约束子类必有方法
class BaseAuthentication:
"""
All authentication classes should extend BaseAuthentication.
"""
def authenticate(self, request):
"""
如果子类继承BaseAuthentication,就必须有authenticate方法,不然报错
"""
raise NotImplementedError(".authenticate() must be overridden.")