This is a very simple dashboard in flask. Basically, the content seen by an anonymous user is contained by bootstrap's class container
. However, upon authentication, the content is not contained and a functional sidebar is provided.
Check out the other sample dashboards:
- Custom dashboard (this repo) ✔
- Scrollable sidebar dashboard ✔
- Fixed sidebar dashboard ✔
- Overlay fixed sidebar dashboard ✔
- Partially collapsible sidebar dashboard ✔
- User authentication
- Flask
- Python
- Flask SQLAlchemy
- Flask Bootstrap
- Flask Migrate
- Flask-Login
- Flask-WTF
- Clone this repository:
git clone git@github.com:GitauHarrison/simple-dashboard-in-flask.git
- Move into the directory:
cd simple-dashboard-in-flask
- Create and activate a virtual environment:
$ virtualenv venv $ source venv/bin/activate # or (if you prefer using virtualenvwrapper) # $ mkvirtualenv venv
- Install dependencies within the virtual environment:
(venv)$ pip3 install -r requirements.txt
- Needed environment variables:
- Create a file called
.env
in the root directory of the project.(venv)$ touch .env
- Add the following lines to the file:
SECRET_KEY=<your secret key>
- Best to create the value of
SECRET_KEY
by runningpython -c "import os; print(os.urandom(24))"
in your terminal.
- Best to create the value of
- Create a file called
- Start the flask server:
(venv)$ flask run
- Access the application on your browser using the link http://localhost:5000
Cheers!