Implementing the SMS subscription functionality

For implementing the subscription functionality, we require to validate the mobile number. Hence we are going to implement the OTP verification functionality before subscribing any mobile number. We require to have a database table to persist the data for OTP generated codes along with mobile number. The following is the code snippet of models.py class with along with OTPModel class:

import osimport datetimefrom shutil import copyfilefrom peewee import *# Copy our working DB to /tmp..db_name = 'quote_database.db'src = os.path.abspath(db_name)dst = "/tmp/{}".format(db_name)copyfile(src, dst)db = SqliteDatabase(dst)class QuoteModel(Model):    class Meta:        database = db id = IntegerField(primary_key= ...

Get Building Serverless Python Web Services with Zappa now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.