For best practice install Ubuntu in a Virtual Machine and run uberJr in sandboxed environment to ensure consistent performance.
We are using version 2.7
run python
in your terminal to check if you have python install.
if a python interpreter is launched, run to check your version
import sys
print (sys.version)
else download python here https://www.python.org/downloads/
Also make sure that pip is installed to install the Python dependencies in the next step.
sudo apt-get install python-setuptools
sudo easy_install pip
Python dependencies will be installed using Pip.
sudo pip install flask
sudo pip install flask-bcrypt
sudo pip install flask_sqlalchemy
sudo pip install requests
sudo pip install googlemaps
sudo pip install psycopg2
sudo apt-get install postgres
Install the PostgresApp from https://postgresapp.com/.
This is the easiest way to run a PostgreSQL Server on Mac. Follow Instructions on site for installation.
Connect to the postgres server with the postgres user:
sudo su - postgres
psql -p5432
Connect to the postgres server with the postgres user:
"/Applications/Postgres.app/Contents/Versions/9.6/bin/psql" -p5432 -d "postgres"
Create a new database called uberjr
create Database uberjr;
Connect to the uberjr
database.
\c uberjr;
To execute the sql statement in databaseSetup.sql
we will just copy and paste the contents of the file into our psql prompt.
To check if the tables have been create successfully you can execute:
\d
Change the postgres password to uberjr
\password postgres;
Clone the repository to your machine. Navigate to the project in your terminal and run to start the webserver:
python webserver.py
UberJr is now running at localhost:5000
uberJr