torcms


Nametorcms JSON
Version 0.9.0 PyPI version JSON
download
home_pagehttps://github.com/bukun/TorCMS
SummaryFlexible, extensible Web CMS framework built on Tornado,compatible with Python 3.7 and above.
upload_time2023-09-24 12:01:02
maintainer
docs_urlNone
authorbukun
requires_python
licenseMIT License
keywords torcms tornado cms
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ==============================
TorCMS Introduction
==============================

Status
==============================

.. image:: https://travis-ci.org/bukun/TorCMS.svg?branch=master
    :target: https://travis-ci.org/bukun/TorCMS

.. image:: https://img.shields.io/pypi/v/torcms.svg
    :target: https://pypi.python.org/pypi/torcms/

.. image:: https://img.shields.io/pypi/pyversions/torcms.svg
    :target: https://pypi.python.org/pypi/torcms/

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

Introduction
==============================

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.
https://pypi.python.org/pypi/torcms . Could be installed via:

::

    pip3 install torcms

Features
==============================

- 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.

Application
==============================

-  http://drr.ikcest.org (Disaster Risk Reduction Knowledge Service of UNESCO)
-  http://wdcrre.data.ac.cn/ (World data center for Renewable Resources and Environment)
-  http://www.wds-china.org/ (ICSU-WDS, World Data System China)
-  https://www.osgeo.cn (OSGeo China Chapter)


-  http://www.maphub.cn (Merged into https://www.osgeo.cn)
-  http://www.yunsuan.org (Merged into https://www.osgeo.cn)


Install
================

Pull the codes.
----------------------

::

    git clone https://github.com/bukun/TorCMS.git

Requirement for the System
---------------------------------------------

Under Debian/Ubuntu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

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


Create the Database
---------------------------

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

::

    \set dbname torcms
    CREATE USER :dbname WITH PASSWORD '111111' ;
    CREATE DATABASE :dbname OWNER :dbname ;
    GRANT ALL PRIVILEGES ON DATABASE :dbname to :dbname ;
    \c :dbname ;
    create extension hstore;
    \q

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


For Deiban/Ubutnu
---------------------------------------

If you are to use Python of OS system directly, install libs as:

::

    sudo apt isntall -y python3-tornado python3-requests python3-openpyxl python3-markdown python3-htmlmin

How to Run
=========================

Get the HTML for modules
----------------------------------

::

    $ cd TorCMS
    $ git clone --depth=1 https://github.com/bukun/torcms_f2elib.git static/f2elib


or using the same f2elib via Gitee:

::

    $ git clone --depth=1 https://gitee.com/bukun/torcms_f2elib.git static/f2elib

Edit the configiure.
-----------------------

::

    $ cd TorCMS/
    $ cp cfg_demo.py cfg.py

And, edit the ``cfg.py`` file.

::

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

    SMTP_CFG = {
        'name': 'TorCMS',
        'host': "smtp.ym.163.com",
        'user': "admin@yunsuan.org",
        'pass': "",
        'postfix': 'yunsuan.org',
    }

    SITE_CFG = {
        'site_url': 'http://127.0.0.1:8888',
        '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.


Initialization
--------------------------------

::

    python3 helper.py -i init

it will

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


Run
---------


Run the web application,

::

    python3 server.py 8088

Open web brower and navigate to http://127.0.0.1:8088 .

The port should as be defined in config.py .

Enjoy it!

Helper Script
=========================================
There are some helper scripts used in the programe.

Run the following command to list the different scripts:

::

    python3 helper.py -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 helper.py -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/conf.py``. 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 setup.py sdist

Then, upload to the website.

::

    twine upload dist/torcms-version.tar.gz




Application
========================================

-  http://www.osgeo.cn (OSGeo中国中心)
-  http://www.wds-china.org (世界数据系统中国)
-  http://wdcrre.data.ac.cn/ (可再生资源与环境世界数据中心)
-  http://drr.ikcest.org (联合国教科文组织国际工程科技知识中心防灾减灾知识服务平台)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bukun/TorCMS",
    "name": "torcms",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "torcms,tornado,cms",
    "author": "bukun",
    "author_email": "bukun@osgeo.cn",
    "download_url": "https://files.pythonhosted.org/packages/1f/f6/36aa4e8c5478ea96a6d2becf33be7fd81de14ff9da7bc60b96d4ddda8f63/torcms-0.9.0.tar.gz",
    "platform": "any",
    "description": "==============================\nTorCMS Introduction\n==============================\n\nStatus\n==============================\n\n.. image:: https://travis-ci.org/bukun/TorCMS.svg?branch=master\n    :target: https://travis-ci.org/bukun/TorCMS\n\n.. image:: https://img.shields.io/pypi/v/torcms.svg\n    :target: https://pypi.python.org/pypi/torcms/\n\n.. image:: https://img.shields.io/pypi/pyversions/torcms.svg\n    :target: https://pypi.python.org/pypi/torcms/\n\nChecking ``torcms`` with ``pylint`` using default configuration (Under Debian 11.0),\ngets score greater than 8.9.\n\nIntroduction\n==============================\n\nFlexible, extensible web CMS framework built on Tornado and Peewee,\ncompatible with Python 3.7 and above. Using PostgreSQL with JSON\nextension as the database( postgresql-server >= 11.0 ).\n\npypi: The kernel of this CMS has been submit to pypi.\nhttps://pypi.python.org/pypi/torcms . Could be installed via:\n\n::\n\n    pip3 install torcms\n\nFeatures\n==============================\n\n- Build on Tornado, only with Web features, which made it is simple to use.\n- Markdown editor, make your HTML clean and clear.\n- Carefull desinged model for conents. Post, Info, Page, Wiki as default.\n- User roles for editing.\n- Full text search with Whoosh.\n- PostgreSQL 9.4 above, with JSONB, which makes the framework extensible.\n- Using XLXS, could be parsed by ``openpyxl``, to define the schema of the database.\n- Access database via Peewee.\n- SASS sub-project for Style.\n- Last version of JQuery. And, Bootstrap as the default CSS framework.\n\nApplication\n==============================\n\n-  http://drr.ikcest.org (Disaster Risk Reduction Knowledge Service of UNESCO)\n-  http://wdcrre.data.ac.cn/ (World data center for Renewable Resources and Environment)\n-  http://www.wds-china.org/ (ICSU-WDS, World Data System China)\n-  https://www.osgeo.cn (OSGeo China Chapter)\n\n\n-  http://www.maphub.cn (Merged into https://www.osgeo.cn)\n-  http://www.yunsuan.org (Merged into https://www.osgeo.cn)\n\n\nInstall\n================\n\nPull the codes.\n----------------------\n\n::\n\n    git clone https://github.com/bukun/TorCMS.git\n\nRequirement for the System\n---------------------------------------------\n\nUnder Debian/Ubuntu\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n    $ sudo apt install -y postgresql postgresql-contrib redis-server\n\n\nCreate the Database\n---------------------------\n\nCreate the database, and user in PostgreSQL.\nThe information should be used in the ``cfg.py`` file.\nAnd, create hstore extension in the database.\n\n::\n\n    \\set dbname torcms\n    CREATE USER :dbname WITH PASSWORD '111111' ;\n    CREATE DATABASE :dbname OWNER :dbname ;\n    GRANT ALL PRIVILEGES ON DATABASE :dbname to :dbname ;\n    \\c :dbname ;\n    create extension hstore;\n    \\q\n\nFor Python\n----------\n\nYou should be under Python 3.4 or Python 3.5.\n\nInstall libs for Python 3.4 or 3.5,\n\n::\n\n    cd TorCMS\n    pip3 install -r doc/requirements.txt\n\n\nFor Deiban/Ubutnu\n---------------------------------------\n\nIf you are to use Python of OS system directly, install libs as:\n\n::\n\n    sudo apt isntall -y python3-tornado python3-requests python3-openpyxl python3-markdown python3-htmlmin\n\nHow to Run\n=========================\n\nGet the HTML for modules\n----------------------------------\n\n::\n\n    $ cd TorCMS\n    $ git clone --depth=1 https://github.com/bukun/torcms_f2elib.git static/f2elib\n\n\nor using the same f2elib via Gitee:\n\n::\n\n    $ git clone --depth=1 https://gitee.com/bukun/torcms_f2elib.git static/f2elib\n\nEdit the configiure.\n-----------------------\n\n::\n\n    $ cd TorCMS/\n    $ cp cfg_demo.py cfg.py\n\nAnd, edit the ``cfg.py`` file.\n\n::\n\n    DB_CFG = {\n        'db': 'torcms',\n        'user': 'torcms',\n        'pass': '111111',\n    }\n\n    SMTP_CFG = {\n        'name': 'TorCMS',\n        'host': \"smtp.ym.163.com\",\n        'user': \"admin@yunsuan.org\",\n        'pass': \"\",\n        'postfix': 'yunsuan.org',\n    }\n\n    SITE_CFG = {\n        'site_url': 'http://127.0.0.1:8888',\n        'cookie_secret': '123456',\n        'DEBUG': False\n    }\n\nThe ``DB_CFG`` defines the items used for PostgreSQL.\n\nModify the meta information of the web application.\n---------------------------------------------------------\n\nModify the file in ``TorCMS/database/meta``.\n\n-  ``doc_catalog.yaml`` , which define the catalog of post.\n-  ``info_tags.xlsx`` , which define the catalog of info.\n\n\nInitialization\n--------------------------------\n\n::\n\n    python3 helper.py -i init\n\nit will\n\n- initialize the PostgreSQL schema.\n- initialize the metadata in database.\n- the whoosh database would be initialized.\n\n\nRun\n---------\n\n\nRun the web application,\n\n::\n\n    python3 server.py 8088\n\nOpen web brower and navigate to http://127.0.0.1:8088 .\n\nThe port should as be defined in config.py .\n\nEnjoy it!\n\nHelper Script\n=========================================\nThere are some helper scripts used in the programe.\n\nRun the following command to list the different scripts:\n\n::\n\n    python3 helper.py -h\n\n\nRun the scripts with the ``-i`` switcher, we have used ``init`` to do something for initialization.\n\n- ``migrate`` : for database schema change.\n- ``edit_diff`` : send email for modification of the posts and pages.\n- ``sitemap`` : would generate the sitemap for posts and pages.\n- ``check_kind`` : to check if the kind of post is right.\n- ``check`` : generate the picture for the relationship of templates. For example:\n\n::\n\n    python3 helper.py -i check templates/theme\n\nwould generate the picture for the relationship of the template files.\n\nUnit Tests\n=========================================\n\nFirst you should install ``pytest``, ``coverage`` and ``pytest-cov`` with ``pip`` ,\n\n::\n\n   pip3 install pytest pytest-cov coverage\n\nthen run as follow:\n\n::\n\n   python3 -m pytest tester --cov=./tester --cov-report=html\n\n\n\nBuild the API documents\n========================================\n\nunder TorCMS\n\n::\n\n    sphinx-apidoc -F -o api_doc torcms\n\nEditing  ``api_doc/conf.py``. Add the following line after ``import sys``.\n\n::\n\n    sys.path.insert(0, os.path.abspath('../'))\n\nThat's OK. then generate the HTML documents. Under TorCMS:\n\n::\n\n    sphinx-build -b html api_doc api_html\n\nPublish to PyPi\n===============================================\n\nFirst, build the distribution.\n\n::\n\n    python setup.py sdist\n\nThen, upload to the website.\n\n::\n\n    twine upload dist/torcms-version.tar.gz\n\n\n\n\nApplication\n========================================\n\n-  http://www.osgeo.cn (OSGeo\u4e2d\u56fd\u4e2d\u5fc3)\n-  http://www.wds-china.org (\u4e16\u754c\u6570\u636e\u7cfb\u7edf\u4e2d\u56fd)\n-  http://wdcrre.data.ac.cn/ (\u53ef\u518d\u751f\u8d44\u6e90\u4e0e\u73af\u5883\u4e16\u754c\u6570\u636e\u4e2d\u5fc3)\n-  http://drr.ikcest.org (\u8054\u5408\u56fd\u6559\u79d1\u6587\u7ec4\u7ec7\u56fd\u9645\u5de5\u7a0b\u79d1\u6280\u77e5\u8bc6\u4e2d\u5fc3\u9632\u707e\u51cf\u707e\u77e5\u8bc6\u670d\u52a1\u5e73\u53f0)\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Flexible, extensible Web CMS framework built on Tornado,compatible with Python 3.7 and above.",
    "version": "0.9.0",
    "project_urls": {
        "Homepage": "https://github.com/bukun/TorCMS"
    },
    "split_keywords": [
        "torcms",
        "tornado",
        "cms"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ff636aa4e8c5478ea96a6d2becf33be7fd81de14ff9da7bc60b96d4ddda8f63",
                "md5": "8605431c0ab5650eee65bcc701776c4b",
                "sha256": "64297cb57b6e2cd5071a6d0b6bc37317d20f9f1c57bfb559430a4b6563d6a952"
            },
            "downloads": -1,
            "filename": "torcms-0.9.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8605431c0ab5650eee65bcc701776c4b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 120568,
            "upload_time": "2023-09-24T12:01:02",
            "upload_time_iso_8601": "2023-09-24T12:01:02.731082Z",
            "url": "https://files.pythonhosted.org/packages/1f/f6/36aa4e8c5478ea96a6d2becf33be7fd81de14ff9da7bc60b96d4ddda8f63/torcms-0.9.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-24 12:01:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bukun",
    "github_project": "TorCMS",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "torcms"
}
        
Elapsed time: 0.64457s