Server - Contents

Flask Blog Demo

revised: 6-Apr-2025

Steps to the Setup

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

sammy@imega:$ unzip blog.zip
sammy@imega:$ cd blog
sammy@imega:/blog $ python3 -m venv .venv
sammy@imega:/blog $ . .venv/bin/activate  Note: the "."
(venv)sammy@imega:$ pip install -r requirement.txt
(venv)sammy@imega:$ python3 init-db.py
(venv)sammy@imega:$ flask run  Note: to stop the app from running: press Ctl-c

The result will have the application running at: http://127.0.0.1:5000/ or http://[MyIP]:5000/ - where MyIP is the IP associate with your server.
The app can downloaded here: blog.zip (8Kb)

A Blog App with Login: Flaskr

This excellent Flask Blog demo can be download here: flaskr.zip (8Kb)

Follow the same first 5 steps above but with 'flaskr.zip'
(venv)sammy@imega:/flaskr$ flask --app flaskr init-db
(venv)sammy@imega:/flaskr$ flask --app flaskr run --debug

Running the Flaskr App as a Service

Using a similar setup for deployment described in Step#3 (PartB) in Flask 3pg Site, one would also use uwsgi but by creating a slightly different
wsgi.py:

Note: None of these demos were designed for web deployment but only for learning purposes.

Advance Flask Flask Roles Demo
Flask -Other Demos