for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
from rest_framework_jwt.settings import api_settings
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
jwt_payload_handler = api_settings.JWT_PAYLOAD_HANDLER
jwt_payload_handler
(([A-Z_][A-Z0-9_]*)|(__.*__))$
This check looks for invalid names for a range of different identifiers.
You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.
If your project includes a Pylint configuration file, the settings contained in that file take precedence.
To find out more about Pylint, please refer to their site.
jwt_encode_handler = api_settings.JWT_ENCODE_HANDLER
jwt_encode_handler
class TokenStrategy:
__init__
@classmethod
def obtain(cls, user):
payload = jwt_payload_handler(user)
return {
'token': jwt_encode_handler(payload),
'user': user
}
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.