- Add following environment variables to use Twilio. E.g. on macOS, open your bash profile:
vim ~/.bash_profile And add the following lines with your values:
export TWILIO_SID=[YOUR_SID]
export TWILIO_TOKEN=[YOUR_TOKEN]Enact changes:
source ~/.bash_profile- Get an API key from LocationIQ: https://locationiq.com/
Add it to your environment variables:
vim ~/.bash_profile And add the following lines with your values:
export LOCATIONIQ_TOKEN=[YOUR_KEY]Enact changes:
source ~/.bash_profile- Create virtual / Conda environment:
virtualenv -p python3 venv - Install in your environment:
source venv/bin/activate
pip install -e .- Install
ngrokto setup light webserver. Follow steps here: https://ngrok.com/download
Largely following this tutorial: https://www.twilio.com/docs/sms/quickstart/python-msg-svc
- Start local server
python run_server.py- ngrok magic
ngrok http 5000- Copy ngrok URL (with the `/whatsapp) in the "WHEN A MESSAGE COMES IN" box: https://www.twilio.com/console/sms/whatsapp/sandbox
Taking ideas from this tutorial: https://medium.com/@dushan14/create-a-web-application-with-python-flask-postgresql-and-deploy-on-heroku-243d548335cc
- Install PostGres: https://thecodersblog.com/PostgreSQL-PostGIS-installation/
brew install postgres
brew install postgisCreate databases:
createdb covid19
createdb clientsEnter:
psql -d covid19brew tap heroku/brew && brew install herokuMake and account and login:
heroku loginDocs for Flask SQL: https://flask-sqlalchemy.palletsprojects.com/en/2.x/queries/ Docs for Bootstrap (framework for website): https://getbootstrap.com/docs/4.4/components/forms/#checkboxes-and-radios
sqlite3 volunteers.db # .exit to quit
sqlite3 clients.db # .exit to quitTo delete
rm *.dblaunch:
python manage.py runserverAdd password to environment variable COVID19_TOKEN.
Get it from Eric.
Endpoint: