Skip to content

A simple dashboarding web application built using Flask and Bootstrap.

Notifications You must be signed in to change notification settings

salimhamed/dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This is a simple dashboarding application built using Flask and Bootstrap. The application has been tested with Python 2.7. It's ready to deploy with AWS Elastic Beanstalk.

Installation

  1. Clone the repository
git clone https://github.com/salimhamed/dashboard.git
  1. Create a virtualenv in the project directory
cd dashboard
virtualenv venv
source venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Create database
./manage db_rebuild
  1. Run tests
./manage.py test
  1. Start development server
./manage.py runserver

Database Operations

PostgreSQL Database Operations

  1. pg_ctl is a utility to initialize, start, stop, or control a PostgreSQL server.
  • pg_ctl status -D DATADIR shows the status of a PostgreSQL database.
  • pg_ctl start -D DATADIR starts the PostgreSQL server
  • pg_ctl stop -D DATADIR stops the PostgreSQL server.
  • pg_ctl stop -D DATADIR -m fast immediately stops the PostgreSQL server rather than waiting for session-initiated disconnection.
  1. postgres is the PostgreSQL server.
  • postgres -D DATADIR starts the PostgreSQL server.
  1. psql is the PostgreSQL interactive terminal.
  • psql -d DATABASE connects to a given database.
  • psql -l lists all available databases.

Destroy and Rebuild Database

  1. The positional argument 'db_rebuild' will delete any existing sqlite database and create a new devlopment database populated with fake data.
./manage db_rebuild

Database Migrations

  1. Create an automatic migration upgrade script
./manage db migrate -m "<migration message>"
  1. Apply the migration upgrade script (note, upgrade script should be reviewed before applying changes)
./manage db upgrade

Resources

Flask Extensions