Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
77448d7
Phase 0: Rewrite README for better conversion
Abdur-rahmaanJ Mar 11, 2026
2623721
Phase 1: Unified CLI with start, initialise, seed, and run commands
Abdur-rahmaanJ Mar 11, 2026
47fd853
Phase 2: Zero-config .env generation
Abdur-rahmaanJ Mar 11, 2026
25ef2cc
Phase 4: Implement REST API for content types
Abdur-rahmaanJ Mar 11, 2026
e5ac527
Phase 8: Update README with Quickstart and Unified CLI documentation
Abdur-rahmaanJ Mar 11, 2026
e87e19a
Phase 8: Add Configuration section to docs and allow env-based DB URL
Abdur-rahmaanJ Mar 11, 2026
610760a
Phase 9: Robust Content Modeler with Rich Text and Image support
Abdur-rahmaanJ Mar 11, 2026
64d893e
Phase 11: Add deploy command to generate Dockerfile
Abdur-rahmaanJ Mar 11, 2026
0e87386
Phase 12: Polish API with pagination, sorting, and optional auth
Abdur-rahmaanJ Mar 11, 2026
a912a9e
Phase 12: Update docs with Deployment and API features
Abdur-rahmaanJ Mar 11, 2026
d722310
feat: improvements
Abdur-rahmaanJ Mar 11, 2026
8ccc49f
Phase 13: Add comprehensive tests for CLI and API, fix conftest.py
Abdur-rahmaanJ Mar 11, 2026
f78cb05
Fix KeyError: 'SEED_SETTINGS' during seeding
Abdur-rahmaanJ Mar 11, 2026
3322eac
Robust subprocess calls in CLI using current interpreter path
Abdur-rahmaanJ Mar 11, 2026
f921190
Handle deleted CWD gracefully in CLI
Abdur-rahmaanJ Mar 11, 2026
88053a4
Add self-healing path recovery to CLI
Abdur-rahmaanJ Mar 11, 2026
8aaae38
Simplify CLI path handling and add www functional tests
Abdur-rahmaanJ Mar 11, 2026
d79394e
Fix FileNotFoundError in CLI when CWD is deleted using PWD env fallback
Abdur-rahmaanJ Mar 12, 2026
7cfc41c
sh dashboard
Abdur-rahmaanJ Mar 12, 2026
9bd6ac6
Robust project scaffolding in start command with better error reporting
Abdur-rahmaanJ Mar 12, 2026
c762653
Allow specifying port and host in run command
Abdur-rahmaanJ Mar 12, 2026
66502a1
Modernize Admin UI with Tailwind and Alpine.js for Contact and Conten…
Abdur-rahmaanJ Mar 12, 2026
dda8fe5
fix: pages
Abdur-rahmaanJ Mar 12, 2026
c63a119
Fix HTML escaping in hyperspace page template
Abdur-rahmaanJ Mar 12, 2026
e68f5bd
feat: Add contenttype in template
Abdur-rahmaanJ Mar 12, 2026
77e2011
Improve deployment with Nginx reverse proxy support
Abdur-rahmaanJ Mar 12, 2026
af9561d
Harden Nginx configuration for production VPS deployment
Abdur-rahmaanJ Mar 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,5 @@ shopyo/static/modules/

# ignore secrets
config.json

exp/
231 changes: 128 additions & 103 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,145 +1,170 @@
# pythoncms

<div align="center">
[![First Timers Only](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://www.firsttimersonly.com/)

**The fastest way to start a CMS in Python.** Build production-grade sites with zero-config, modular themes, and a powerful content API.

## 🚀 Quickstart

<img src="https://github.com/shopyo/pythoncms/raw/main/assets/logo.png" width="200"/>
The new unified CLI makes it easier than ever to get started:

<br><br>
```bash
pip install pythoncms
pythoncms start mysite --run
```

[![First Timers Only](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://www.firsttimersonly.com/)
This single command will:
1. Create your project directory.
2. Generate a secure `.env` file.
3. Initialise the database.
4. Seed the default admin user.
5. Start the development server.

🇲🇺
Open: `http://localhost:5000/dashboard`
Login: `admin@domain.com` / `pass`

</div>
---

## 🛠️ Unified CLI Commands

Manage your entire project from one place:

# Welcome to pythoncms
- `pythoncms start <name>`: Create a new project.
- `pythoncms run`: Start the dev server.
- `pythoncms initialise`: Set up database and assets.
- `pythoncms seed`: Reset default data.
- `pythoncms deploy`: Generate production files (Dockerfile, docker-compose.yml).
- `pythoncms --version`: Check your version.

## Try
---

![](https://github.com/shopyo/pythoncms/raw/main/assets/term.gif)
## 🚀 Production Deployment

In virtual env
Deploying your CMS with a production-grade Nginx reverse proxy is now a single command:

```
pip install pythoncms
pythoncms start mysite
cd mysite
shopyo initialise
flask shopyo-seed
flask --debug run
```bash
pythoncms deploy
```

If .env file not created, create .env file with content
This generates:
- **Dockerfile**: Optimized for Gunicorn performance.
- **nginx.conf**: Configured for request buffering and fast static file serving.
- **docker-compose.yml**: Orchestrates the app and Nginx containers.

```.env
ACTIVE_FRONT_THEME = 'editorial'
ACTIVE_BACK_THEME = 'sneat'
APP_NAME = 'Demo'
ACTIVE_ICONSET = 'boxicons'
SITE_TITLE = 'Site title'
SITE_DESCRIPTION = 'Site title'
```
### Quick Start
1. Run `pythoncms deploy`.
2. (Optional) Edit `nginx.conf` to add your domain.
3. Run `docker-compose up --build -d`.

## Local dev
Your site will be live on port 80 with Nginx handling all incoming traffic.

Install package
---

! Important: Please create and activate a virtual environment.
## 📡 REST API

```
python -m pip install -e .
```
Then initialise
Your content is automatically exposed via a JSON API.

```
cd pythoncms
shopyo initialise
flask --debug run
```
**Endpoint:** `/api/v1/<content_type_name>`

for migrating
### Pagination & Sorting
- `?limit=10&offset=0`
- `?sort_by=created_at&order=desc`

```
flask db migrate
flask db upgrade
```
### Authentication (Optional)
Set `API_TOKEN` in your `.env` to secure the API.
Requests must then include header: `Authorization: Bearer <API_TOKEN>`

run
---

```
flask --debug run
```
## ⚙️ Configuration

dashboard
Your project settings are managed via the `.env` file in your root directory.

login with `admin@domain.com` | `pass`
```
http://127.0.0.1:5000/dashboard/
### Database Connection
By default, `pythoncms` uses SQLite. To use a different database, update the `SQLALCHEMY_DATABASE_URI`:

```bash
# SQLite (default)
SQLALCHEMY_DATABASE_URI = "sqlite:///mysite.db"

# PostgreSQL
SQLALCHEMY_DATABASE_URI = "postgresql://user:password@localhost/dbname"
```

## Theme
### Other Settings
- `APP_NAME`: Change the display name of your application.
- `SECRET_KEY`: Used for session encryption. Automatically generated on `start`.
- `ACTIVE_FRONT_THEME`: Choose between `editorial` or `hyperspace`.
- `ACTIVE_BACK_THEME`: Choose between `sneat` or `sbadmin`.

Themes are located at '/static/themes/'
---

Each front theme must have
## ✨ Features

```
index.html
contact.html
page.html
```
- 🏗️ **Content Types:** Define custom schemas with JSON.
- 🎨 **Theme Support:** Switch between beautiful, responsive themes instantly.
- 🔐 **Built-in Auth:** Secure admin and user management out of the box.
- 🍱 **Modular Architecture:** Extend functionality with a robust plugin system.
- 🖼️ **Media Management:** Simple upload and resource handling.
- ⚡ **Flask Powered:** Minimal, fast, and easy to customize.

Each back theme must have
---

```
base.html
login.html
register.html
unconfirmed.html
```
## 📸 See it in Action

- info.json
### Admin Dashboard
![Admin Dashboard](https://github.com/shopyo/pythoncms/raw/main/assets/dashboard_preview.png)

```json
{
"author": "ARJ",
"version": "1.0.20000000000003"
}
```
### Page Editor
![Page Editor](https://github.com/shopyo/pythoncms/raw/main/assets/editor_preview.png)

## Info json
### Website Frontend
![Website Frontend](https://github.com/shopyo/pythoncms/raw/main/assets/frontend_preview.png)

```
{
"display_string": "Admin",
"type": "show", // hidden if hide
"icons":{
"fa": "fas fa-user-lock", // set according to ACTIVE_ICONSET
"boxicons": "", // set according to ACTIVE_ICONSET
"file": "icon.svg" // if present, will be used and searched for
// in module/static. Make sure to shopyo collecstatic in production
},
"url_prefix": "/appadmin",
"menu": {
"list users":"/", // url-prefix will be concatenated with it for sub menus.
"add user": "/add",
"roles":"/roles"
},
"menu-type": "show-menu", // or no-menu. Expects menu key if show-menu.
"module_name": "appadmin",
"author": {
"name":"Abdur-Rahmaan Janhangeer",
"website":"https://www.pythonkitchen.com/about-me/",
"mail":"arj.python@gmail.com"
}
}
```
## Changelog
---

## 🛠️ Local Development

If you want to contribute to the core or customize the engine:

1. **Clone and Install:**
```bash
python -m pip install -e .
```

2. **Initialize:**
```bash
cd pythoncms
shopyo initialise
flask --debug run
```

3. **Database Migrations:**
```bash
flask db migrate
flask db upgrade
```

---

## 🎨 Themes & Customization

Themes are located at `/static/themes/`.

### Front Themes
Must include `index.html`, `contact.html`, and `page.html`.

### Back Themes
Must include `base.html`, `login.html`, `register.html`, and `unconfirmed.html`.

---

## 📄 License & Community

- **License:** MIT
- **Discord:** [Join our community](https://discord.com/invite/k37Ef6w)
- **Issues:** [Report a bug](https://github.com/shopyo/pythoncms/issues)

1.2.0
---

- Tiny MCE configured
- start command
*Powered by the Shopyo engine.*
4 changes: 4 additions & 0 deletions pythoncms/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .cli import cli

if __name__ == "__main__":
cli()
Loading