dashboard
dashboard copied to clipboard
A simple dashboarding web application built using Flask and Bootstrap.
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
- Clone the repository
git clone https://github.com/salimhamed/dashboard.git
- Create a virtualenv in the project directory
cd dashboard
virtualenv venv
source venv/bin/activate
- Install dependencies
pip install -r requirements.txt
- Create database
./manage db_rebuild
- Run tests
./manage.py test
- Start development server
./manage.py runserver
Database Operations
PostgreSQL Database Operations
-
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.
-
postgres
is the PostgreSQL server.
-
postgres -D DATADIR
starts the PostgreSQL server.
-
psql
is the PostgreSQL interactive terminal.
-
psql -d DATABASE
connects to a given database. -
psql -l
lists all available databases.
Destroy and Rebuild Database
- 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
- Create an automatic migration upgrade script
./manage db migrate -m "<migration message>"
- Apply the migration upgrade script (note, upgrade script should be reviewed before applying changes)
./manage db upgrade
Resources
- Flask Documentation
- Bootstrap Documentation
- SB Admin 2 Bootstrap Template
- Miguel Grinberg Flask Web Development Book
- Miguel Grinberg Flask Web Development GitHub