A sample flask app which provides APIs for sending SMS.
- Python 3.4
- Flask
- PostgreSQL
- Redis
- Flask-SQLAlchemy, Flask-RESTful, Flask-HTTPAuth, Flask-Redis
Prerequisites
- PostgreSQL >= 9.0 - https://www.postgresql.org/docs/current/static/tutorial-install.html
- Redis >= 2.8 - https://redis.io/download#installation
- Load datadump in PostgreSQL -
psql -U <username> <db_name> < testdatadump.txt
- Python >= 3.4 - https://www.python.org/downloads/
After all prerequisites are installed, follow these steps :
- Clone this repo -
git clone https://github.com/mehtadhaval/python-flask-sample-app.git
- Change into the directory -
cd python-flask-sample-app
- Create virtualenv -
virtualenv venv --python=/usr/bin/python34
- Activate virtualenv -
source venv/bin/activate
- Install required python libs -
pip install -r requirements.pip
- Update config according to local environment in
config_dev.py
- Start the server -
python run.py
This app is bundled with test cases. To run test cases, just execute
python tests.py
If all tests pass, it should print following output
---------------------------------------------------
Ran 12 tests in 10.233s
OK