Skip to content

DaaanielTV/forgecms

ForgeCMS

ForgeCMS is a Flask-based blogging and CMS application backed by MariaDB. It includes authentication, an admin workflow for draft/scheduled/published content, Markdown authoring, and media upload support.

Overview

What ForgeCMS provides

  • User registration and login
  • Admin content management experience
  • Post workflow states (draft, scheduled, published, archived)
  • Preview support for unpublished posts
  • SEO-friendly slugs and Bootstrap-based responsive UI
  • Image upload support for post media

Repository layout

  • app/ – Flask application package (blueprints, models, app factory)
  • templates/ – Jinja2 HTML templates
  • static/ – CSS and uploaded/static assets
  • migrations/ – Database migration artifacts (including migrations/manual/ SQL files)
  • wsgi.py – WSGI entrypoint for local/dev server startup

Tech stack

  • Python 3.8+
  • Flask
  • SQLAlchemy + Flask-Migrate
  • MariaDB 10.5+
  • Bootstrap 5

Installation

1) Clone the repository

git clone <repository-url>
cd forgecms

2) Create and activate a virtual environment

python -m venv venv
# Linux/macOS
source venv/bin/activate
# Windows (PowerShell)
# .\venv\Scripts\Activate.ps1

3) Install dependencies

pip install -r requirements.txt

4) Create MariaDB database and user

CREATE DATABASE forgecms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'forgecms'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON forgecms.* TO 'forgecms'@'localhost';
FLUSH PRIVILEGES;

5) Configure environment variables

Copy .env.example to .env and update values as needed:

cp .env.example .env

Example values:

FLASK_APP=app
FLASK_ENV=development
SECRET_KEY=change-this-to-a-secure-secret-key
DB_HOST=localhost
DB_USER=forgecms
DB_PASSWORD=your_password
DB_NAME=forgecms
UPLOAD_FOLDER=static/uploads
MAX_CONTENT_LENGTH=16777216

Notes:

  • UPLOAD_FOLDER should stay inside static/ so uploaded media is web-accessible.
  • MAX_CONTENT_LENGTH is in bytes (16777216 = 16 MB).

6) Apply database migrations

flask db upgrade

Usage

Run the development server

flask run

By default, Flask serves on http://127.0.0.1:5000.

Create an admin user (Flask shell)

flask shell
from app import db
from app.models import User

admin = User(username='admin', email='admin@example.com', is_admin=True)
admin.set_password('your-secure-password')
db.session.add(admin)
db.session.commit()

Useful maintenance commands

# Create a new migration after model changes
flask db migrate -m "describe change"

# Apply pending migrations
flask db upgrade

# Backup database
mysqldump -u your_user -p forgecms > backup.sql

Production notes

For production, run with a WSGI server (for example Gunicorn) behind NGINX, use HTTPS, and set a strong SECRET_KEY.

Community and governance

About

A modern blog/CMS system built with Flask and MariaDB, featuring auth, admin content management, Markdown posts, image uploads, and SEO-friendly URLs.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors