Server - Contents

Flask Roles Demo#1

revised: 6-Apr-2025

For an institutional website, the need to have specific pages or areas designated as private and accessible only to authorized person is often felt. The demo here provides a learning environment but also a beginning of such an equipped website.

The Setup

Download this compressed folder: kcraz.zip (7Kb) and upload it (eg. via Filezilla - FTP client) to a home directory (eg. /home/sammy).

With the initial virtual environment described in the Flask 3pg Site and assuming an Ubuntu server environment:

sammy@imega:$ unzip kcraz.zip
sammy@imega:$ cd kcraz
sammy@imega:~/kcraz $ python3 -m venv venv
sammy@imega:~/kcraz $ . venv/bin/activate
(venv)sammy@imega:~/kcraz$ pip install -r requirements
(venv)sammy@imega:~/kcraz$ flask run

The app will now be served on http://0.0.0.0:5000 and one can see the app via the browser at http://(MyIP or MyDomain):5000 and logon with your Admin details

Flask Roles Demo#2

This is a Flask app worthwhile to be a useful website for an office or group seeking to have private pages accessible according to specific roles, and easily controlled by an administrator. Download this compressed folder: appbuild.zip (16Kb)

Follow the same first 5 steps above but with 'appbuild.zip'
(venv)sammy@imega:~/appbuilder/$ cd myapp/
(venv)sammy@imega:~/appbuilder/myapp$ export FLASK_APP=app
(venv)sammy@imega:~/appbuilder/myapp$ flask run

Note:
1. The existing database has the admin user login as: admin passwd: admin or before running 'flask run' execute this command: flask fab create-admin
2. The Flask-Appbuilder Site give several different commands and options.

Flask Blog Demo Advance Flask
Flask - Other Demos