1. Secondary encapsulation of Tencent Cloud SMS
Create the tx_sms directory in the lib directory, and then create the sms.py file (Tencent Cloud SMS V2 source code)
import random
from qcloudsms_py import SmsSingleSender
from qcloudsms_py.httpclient import HTTPError
from .settings import *
from utils.logging import get_logger
# 获取验证码的函数(4位数字)
logger = get_logger()