Skip to main content

Flexible, extensible Web CMS framework built on Tornado,compatible with Python 3.7 and above.

Project description


Checking torcms with pylint using default configuration (Under Debian 11.0), gets score greater than 8.9.


Flexible, extensible web CMS framework built on Tornado and Peewee, compatible with Python 3.7 and above. Using PostgreSQL with JSON extension as the database( postgresql-server >= 11.0 ).

pypi: The kernel of this CMS has been submit to pypi. . Could be installed via:

pip3 install torcms


  • Build on Tornado, only with Web features, which made it is simple to use.
  • Markdown editor, make your HTML clean and clear.
  • Carefull desinged model for conents. Post, Info, Page, Wiki as default.
  • User roles for editing.
  • Full text search with Whoosh.
  • PostgreSQL 9.4 above, with JSONB, which makes the framework extensible.
  • Using XLXS, could be parsed by openpyxl, to define the schema of the database.
  • Access database via Peewee.
  • SASS sub-project for Style.
  • Last version of JQuery. And, Bootstrap as the default CSS framework.



Pull the codes.

git clone

Requirement for the System

Under Debian/Ubuntu

$ sudo apt install -y postgresql-server-dev-all postgresql-contrib redis-server

Create the Database

Create the database, and user in PostgreSQL. The information should be used in the file. And, create hstore extension in the database.

\set dbname torcms
CREATE USER :dbname WITH PASSWORD '111111' ;
CREATE DATABASE :dbname OWNER :dbname ;
\c :dbname ;
create extension hstore;

For Python

You should be under Python 3.4 or Python 3.5.

Install libs for Python 3.4 or 3.5,

cd TorCMS
pip3 install -r doc/requirements.txt

How to Run

Get the HTML for modules

$ cd TorCMS
$ git clone static/f2elib
$ git clone templates/modules

or using the same f2elib via Gitee:

$ git clone static/f2elib
$ git clone templates/modules

Edit the configiure.

$ cd TorCMS/
$ cp

And, edit the file.

DB_CFG = {
    'db': 'torcms',
    'user': 'torcms',
    'pass': '111111',

    'name': 'TorCMS',
    'host': "",
    'user': "",
    'pass': "",
    'postfix': '',

    'site_url': '',
    'cookie_secret': '123456',
    'DEBUG': False

The DB_CFG defines the items used for PostgreSQL.

Modify the meta information of the web application.

Modify the file in TorCMS/database/meta.

  • doc_catalog.yaml , which define the catalog of post.
  • info_tags.xlsx , which define the catalog of info.


python3 -i init

it will

  • initialize the PostgreSQL schema.
  • initialize the metadata in database.
  • the whoosh database would be initialized.


Run the web application,

python3 8088

Open web brower and navigate to .

The port should as be defined in .

Enjoy it!

Helper Script

There are some helper scripts used in the programe.

Run the following command to list the different scripts:

python3 -h

Run the scripts with the -i switcher, we have used init to do something for initialization.

  • migrate : for database schema change.
  • edit_diff : send email for modification of the posts and pages.
  • sitemap : would generate the sitemap for posts and pages.
  • check_kind : to check if the kind of post is right.
  • check : generate the picture for the relationship of templates. For example:
python3 -i check templates/theme

would generate the picture for the relationship of the template files.

Unit Tests

First you should install pytest, coverage and pytest-cov with pip ,

pip3 install pytest pytest-cov coverage

then run as follow:

python3 -m pytest tester --cov=./tester --cov-report=html

Build the API documents

under TorCMS

sphinx-apidoc -F -o api_doc torcms

Editing api_doc/ Add the following line after import sys.

sys.path.insert(0, os.path.abspath('../'))

That’s OK. then generate the HTML documents. Under TorCMS:

sphinx-build -b html api_doc api_html

Publish to PyPi

First, build the distribution.

python sdist

Then, upload to the website.

twine upload dist/torcms-version.tar.gz

In Chinese

本 CMS 是使用Python 3.4,Tornado Web框架, Peewee,开发的。 此CMS系统原本用于 云算笔记开放地理空间实验室 (现合并到 OSGeo中国中心 )等网站, 后来慢慢将 CMS 从中抽取出来。

在网站设计方面,提出了文档(Post)、信息(Infor)两种对等的模型进行信息的组织。 这两种模型结构相似,分别用与网站的内容管理,以及应用管理。 其中应用管理,使用了PostgreSQL的JSON扩展,可以设计为App、分类信息、商城应用等。 这些可以在下面的应用中看一下。



Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for torcms, version 0.8.6
Filename, size File type Python version Upload date Hashes
Filename, size torcms-0.8.6.tar.gz (103.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page