#新媒体舆情
This commit is contained in:
parent
c62a91992e
commit
09871d14cf
|
@ -6,7 +6,8 @@ from django_token.models import Token
|
|||
import datetime
|
||||
|
||||
from .models import VerifyCode
|
||||
from .utils import generate_code, send_sms_code
|
||||
#这个地方sent_sms_code原先是send_sms_code,报错
|
||||
from .utils import generate_code, sent_sms_code
|
||||
|
||||
|
||||
def index(request):
|
||||
|
@ -71,7 +72,7 @@ def send_code(request):
|
|||
code = generate_code()
|
||||
now = datetime.datetime.now()
|
||||
after_10mins = now + datetime.timedelta(minutes=10)
|
||||
response = send_sms_code(phone, code)
|
||||
response = sent_sms_code(phone, code)
|
||||
result = response.decode('utf8')
|
||||
if "OK" in result:
|
||||
VerifyCode.objects.create(code=code, phone=phone, category=category)
|
||||
|
|
Loading…
Reference in New Issue