<filename>kakao_message_utils/request_token.py
import token_def

# To get Authorization Code
# https://kauth.kakao.com/oauth/authorize?client_id=cc335daa766cc74b3de1b1c372a6cce8&response_type=code&redirect_uri=https://localhost.com

KAKAO_APP_KEY = "<KEY>"  # REST_API app key
AUTHORIZATION_CODE = "<KEY>"  # once in a run
KAKAO_TOKEN_FILENAME = "/Users/jeongwon/Documents/GitHub/project_news_summarize/json/kakao_token.json"  # Token in this file(.json)

# To get Access Token
tokens = token_def.request_tokens(KAKAO_APP_KEY, AUTHORIZATION_CODE)

# To save Access Token in the file(.json)
token_def.save_tokens(KAKAO_TOKEN_FILENAME, tokens)

# # To update Refresh Token after the Access Token is expired
# tokens=token_def.update_tokens(KAKAO_APP_KEY, KAKAO_TOKEN_FILENAME)
# token_def.save_tokens(KAKAO_TOKEN_FILENAME, tokens)

<filename>kakao_message_utils/request_token.py
import token_def

# To get Authorization Code
# https://kauth.kakao.com/oauth/authorize?client_id=cc335daa766cc74b3de1b1c372a6cce8&response_type=code&redirect_uri=https://localhost.com

KAKAO_APP_KEY = "<KEY>"  # REST_API app key
AUTHORIZATION_CODE = "<KEY>"  # once in a run
KAKAO_TOKEN_FILENAME = "/Users/jeongwon/Documents/GitHub/project_news_summarize/json/kakao_token.json"  # Token in this file(.json)

# To get Access Token
tokens = token_def.request_tokens(KAKAO_APP_KEY, AUTHORIZATION_CODE)

# To save Access Token in the file(.json)
token_def.save_tokens(KAKAO_TOKEN_FILENAME, tokens)

# # To update Refresh Token after the Access Token is expired
# tokens=token_def.update_tokens(KAKAO_APP_KEY, KAKAO_TOKEN_FILENAME)
# token_def.save_tokens(KAKAO_TOKEN_FILENAME, tokens)

# To get Authorization Code # https://kauth.kakao.com/oauth/authorize?client_id=cc335daa766cc74b3de1b1c372a6cce8&response_type=code&redirect_uri=https://localhost.com # REST_API app key # once in a run # Token in this file(.json) # To get Access Token # To save Access Token in the file(.json) # # To update Refresh Token after the Access Token is expired # tokens=token_def.update_tokens(KAKAO_APP_KEY, KAKAO_TOKEN_FILENAME) # token_def.save_tokens(KAKAO_TOKEN_FILENAME, tokens)