40--Django-project combat-full stack development-based on django+drf+vue+elementUI enterprise-level project development process-Tencent Cloud SMS secondary packaging, registration page

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()


Guess you like

Origin blog.csdn.net/BLee_0123/article/details/130333702