Skip to Main Content
Building Serverless Python Web Services with Zappa
book

Building Serverless Python Web Services with Zappa

by Abdulwahid Abdulhaque Barguzar
July 2018
Intermediate to advanced content levelIntermediate to advanced
324 pages
8h 14m
English
Packt Publishing
Content preview from Building Serverless Python Web Services with Zappa

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= ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Docker for Microservices with Python

Hands-On Docker for Microservices with Python

Jaime Buelta

Publisher Resources

ISBN: 9781788837613Supplemental Content