##Installing steps
- Untar the tar file using tar -xvf restaurant_review.tar
- Change directory to cd resturant_review cd restaurant_review
- Make sure you are using Python2.7 and virtualenv is installed a. Ubuntu or linux pip install virtualenv b. Mac users only brew install virtualenv
- Sourcing the env.sh file source tools/env.sh
- Initialize the db by running this command python -m revapp.manage db upgrade
- Running the app python server.py
- To create a migration repository python -m revapp.manage db init
- To initialize migration python -m revapp.manage db migrate
- If the user has uploaded migration script. After reviewing please run the following command to migrate to new version python -m revapp.manage db upgrade
- Use the following command to drop the python -m revapp.manage drop
- Use the following command to create the db python -m revapp.manage create
- If you are planning to make some schema changes. Make sure you run the command and upload the revision_.py python -m revapp.manage db migrate
- Use the following command to see url_map python -m revapp.manage list_routes
Execute Python in bash with virtualenv enabled python
>>> from flask import Flask
>>> from flask_sqlalchemy import SQLAlchemy
>>> app.config.from_object(settings)
>>> db = SQLAlchemy(app)
>>> app_ctx = app.app_context()
>>> app_ctx.push()
>>> app.name
'revapp'
>>> app.url_map
Map([<Rule '/user' (HEAD, POST, OPTIONS, GET) -> user>,
<Rule '/' (HEAD, OPTIONS, GET) -> hello_world>,
<Rule '/static/<filename>' (HEAD, OPTIONS, GET) -> static>])