def generate_token(user):
    " Currently this is workaround\n    since the latest version that already has this function\n    is not published on PyPI yet and we don't want\n    to install the package directly from GitHub.\n    See: https://github.com/mattupstate/flask-jwt/blob/9f4f3bc8dce9da5dd8a567dfada0854e0cf656ae/flask_jwt/__init__.py#L145\n    "
    jwt = current_app.extensions['jwt']
    token = jwt.jwt_encode_callback(user)
    return token
Currently this is workaround
since the latest version that already has this function
is not published on PyPI yet and we don't want
to install the package directly from GitHub.
See: https://github.com/mattupstate/flask-jwt/blob/9f4f3bc8dce9da5dd8a567dfada0854e0cf656ae/flask_jwt/__init__.py#L145
def generate_token(user):
    " Currently this is workaround\n    since the latest version that already has this function\n    is not published on PyPI yet and we don't want\n    to install the package directly from GitHub.\n    See: https://github.com/mattupstate/flask-jwt/blob/9f4f3bc8dce9da5dd8a567dfada0854e0cf656ae/flask_jwt/__init__.py#L145\n    "
    jwt = current_app.extensions['jwt']
    token = jwt.jwt_encode_callback(user)
    return token