- Python 2.7
- pip
- Mysql
- Platform: Linux
import os saved_stdout = sys.stdout sys.stdout = StringIO() os.system('which python') testout = sys.stdout.getvalue() sys.stdout.close() sys.stdout = saved_stdout print testout
Edit Settings.py file for twilio and other configuration
While you are in the root directory of project run
sudo sh setup.sh
OR
- pip install -r requirements.txt
- mysql -u root -p
- Enter mysql password when prompted.
- Create DB by "CREATE DATABASE msgapp;"
- run "python app.py"
Language: Python, JS, HTML, CSS
Framework: Flask, Bootstrap
Template Engine: Jinja2
ORM: SqlAlchemy
The app uses linux inbuilt crontab for setting up cron job. For setting up crons within Python code python-crontab module is used.
Tables: users, reminders
Users table
id (Primary Key, auto_increment) name phone (unique) country_code timezone night_start night_end created_on updated_on
Reminders table
id (Primary Key, auto_increment) phone( Forein key reference users.phone) reminder_status error reminder_message created_on updated_on
├── app.py
├── __init__.py
├── msgapp
│ ├── cron.py
│ ├── __init__.py
│ ├── messenger.py
│ ├── models
│ │ ├── __init__.py
│ │ ├── user.py
│ ├── utils.py
│ ├── views.py
├── settings.py
├── setup.sh
├── templates
├── base.html
└── msgapp
├── index.html
├── info.html
├── reminder_info.html
└── 404.html
- Create a (basic) web based application where John can set his phone number: Screenshot
- Send an SMS every one hour except at night: Screenshot(sent at every 2 minutes)
- Try resending an SMS if it fails, but retry no more than 5 times. Retry source code
- The web application should also log all the failed messages and tell John for how many hours the application has been running. Screenshot2
Do not send message during night: Source Code , Nightmode