{"id":13626067,"url":"https://github.com/whiteclover/white","last_synced_at":"2025-04-16T11:31:14.138Z","repository":{"id":28390572,"uuid":"31904814","full_name":"whiteclover/white","owner":"whiteclover","description":"A Blog Cms Website backed by MySQL in Flask\u0026Python","archived":false,"fork":false,"pushed_at":"2020-10-01T12:22:53.000Z","size":321,"stargazers_count":114,"open_issues_count":1,"forks_count":23,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-08T15:47:04.372Z","etag":null,"topics":["flask-application"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whiteclover.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-09T15:01:21.000Z","updated_at":"2024-06-14T12:45:16.000Z","dependencies_parsed_at":"2022-09-03T15:52:01.720Z","dependency_job_id":null,"html_url":"https://github.com/whiteclover/white","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whiteclover%2Fwhite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whiteclover%2Fwhite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whiteclover%2Fwhite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whiteclover%2Fwhite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whiteclover","download_url":"https://codeload.github.com/whiteclover/white/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249235046,"owners_count":21235137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask-application"],"created_at":"2024-08-01T21:02:09.127Z","updated_at":"2025-04-16T11:31:12.494Z","avatar_url":"https://github.com/whiteclover.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"White\n#########\n\nMoved to `Zephyr \u003chttps://github.com/whiteclover/Zephyr\u003e`_\n\nWhite is a blog cms. it's based `Anchor-cms \u003chttps://github.com/anchorcms/anchor-cms\u003e`_ that a blog cms wrote by php.\nThe White project keeps the most of achor-cms features, but pythonic and some new feartures:\n\n#. write blog use markdown\n#. custom field extension\n#. custom theme\n#. multi-languages support\n#. rss feed\n#. some monitor api for mananger\n#. database connection pool\n#. memozie cache\n#. take advantage of Flask and Jinjia2\n\n\n.. image:: https://github.com/thomashuang/white/blob/master/snap/home.png\n\n\n.. contents::\n    :depth: 2\n\nInstall\n==============\n\n\nFirstly download or fetch it form github then run the command in shell:\n\n.. code-block:: bash\n\n    pip install -r requirements.txt\n\nor::\n\nFirstly download or fetch it form github then run the command in shell:\n\n.. code-block:: bash\n\n    cd white # the path to the project\n    python setup.py install\n\nDevelopment\n===========\n\nFork or download it, then run:\n\n.. code-block:: bash \n\n    cd white # the path to the project\n    python setup.py develop\n\nCompatibility\n=============\n\nBuilt and tested under Python 2.7 \n\nSetup Database\n==============\n\n* create database in mysql:\n* then run the mysql schema.sql script in the project directoy schema:\n\n.. code-block:: bash\n\n    mysql -u yourusername -p yourpassword yourdatabase \u003c schema.sql\n\n\nif your database has not been created yet, log into your mysql first using:\n\n.. code-block:: bash\n\n    mysql -u yourusername -p yourpassword yourdatabase\n    mysql\u003eCREATE DATABASE a_new_database_name\n    # = you can =\n    mysql\u003e USE a_new_database_name\n    mysql\u003e source schema.sql\n\n\n\nwhen firstly run the project, please use the root account, then go to user management ui change your account info:\n\n:username: white \n:password: white\n\n\nSetup Config file\n=====================\n\n\nCurrently, using hocon config. the primary goal of hocon is: keep the semantics (tree structure; set of types; encoding/escaping) from JSON, but make it more convenient as a human-editable config file format.\n\n.. code-block:: python\n\n\tHOST = \"localhost\" # server host\n\tPORT = 5000 # server port\n\n\tDEBUG = on # off # open debug mode\n\n\n\t## Flask Session module\n\t# session\n\tSECRET_KEY = \"7oGwHH8NQDKn9hL12Gak9G/MEjZZYk4PsAxqKU4cJoY=\"\n\tSESSION_TYPE = \"filesystem\"\n\tSESSION_FILE_DIR = \"/var/www/$yoursite.com/cookies\"\n\n\n\n\t## Flask Session module\n\t# session\n\tSECRET_KEY = \"7oGwHH8NQDKn9hL12Gak9G/MEjZZYk4PsAxqKU4cJoY=\"\n\n\tSESSION_TYPE = \"filesystem\" # \"redis\" \n\t## REDIS_HOST = 127.0.0.1\n\t#PERMANENT_SESSION_LIFETIME = 60\n\n\tSESSION_FILE_DIR = \"cookie\"\n\tSESSION_FILE_THRESHOLD = 100\n\tSESSION_FILE_MODE = 0600\n\n\tSESSION_FILE_THRESHOLD = 100\n\tSESSION_FILE_MODE = 0600\n\n\n\t## DB Config\n\tDB_CONFIG  {\n\t    db = white\n\t    user = white\n\t    passwd = white\n\t    host = localhost\n\n\t    max_idle = 10 # the mysql timeout setting\n\t}\n\n\t# DB POOL Size \n\tDB_MAXCONN = 10\n\tDB_MINCONN = 5\n\n\n\t# STATIC_FOLDER=\"pathTo/assets\" # static folder if your wanna set custom you media assets\n\n\tCONTENT_PATH = \"/var/www/$yoursite.com/content\"\n\tLANGUAGE = \"en_GB\"\n\tTHEME = \"default\"\n\n\nIf your wanna set session adapter please see more information in `flask-session \u003chttp://pythonhosted.org/Flask-Session/\u003e`_ doc.\n\n\nRun in console\n================\n\n\n\nThe terminal help options\n--------------------------\n\n\n.. code-block:: bash\n\n\t\u003e python whited -h\n\tusage: whited [options]\n\n\toptional arguments:\n\t  -h, --help            show this help message and exit\n\t  -host HOST, --host HOST\n\t                        the host for run server\n\t  -p PORT, --port PORT  the port for run server\n\t  -d, --debug           open debug mode (default False)\n\t  -c FILE, --config FILE\n\t                        config path (default '/etc/white/config')\n\n\n\nTry run\n--------------\n\nIf you wanna use production mode and ``whited`` running the blog service, please install ``gevent`` firstly. \n\n.. code-block:: bash\n\n\t\u003e python whited -c=conf/config -d\n\t * Running on http://127.0.0.1:5000/\n\t * Restarting with reloader\n\n\nRun White in Other WSGI Servers\n----------------------------------\n\nWhen you wanna use other wsgi servers, just booststrap app, then take the app in your server api:\n\n.. code-block:: python\n\n\tfrom white.server import WhiteServer\n\n\tserver = WhiteServer()\n\tapp = server.bootstrap()\n\n\twsgi_server_run(app) # your wsgi warpper\n\n\n\nMonitor Api\n================\n\nAll apis require admin permisssion, please take admin user session.\n\nDB status check\n---------------------------------\n\n\tGET /admin/meta/db_status.json\n\n\n.. code-block:: json\n\n\t{\n\t  \"message\": \"Fine\", \n\t  \"status\": \"ok\"\n\t}\n\n\nGet Application config\n--------------------------\n\n\n\tGET /admin/meta/config.json\n\n\n.. code-block:: json\n\n\t{\n\t  \"APPLICATION_ROOT\": null, \n\t  \"CONTENT_PATH\": \"$content_path\", \n\t  \"CSRF_SECRET\": \"hide: e8c78f7bfe8eccf18b1e731a27a7e2835739a9c8a354559ad5eced4c5f76d909\", \n\t  \"DB_CONFIG\": {\n\t    \"db\": \"white\", \n\t    \"host\": \"localhost\", \n\t    \"max_idle\": 10, \n\t    \"passwd\": \"hide: d38681074467c0bc147b17a9a12b9efa8cc10bcf545f5b0bccccf5a93c4a2b79\", \n\t    \"user\": \"white\"\n\t  }, \n\t  \"DB_MAXCONN\": 10, \n\t  \"DB_MINCONN\": 5, \n\t  \"DEBUG\": true, \n\t  \"HOST\": \"localhost\", \n\t  \"JSONIFY_PRETTYPRINT_REGULAR\": true, \n\t  \"JSON_AS_ASCII\": true, \n\t  \"JSON_SORT_KEYS\": true, \n\t  \"LANGUAGE\": \"en_GB\", \n\t  \"LOGGER_NAME\": \"white\", \n\t  \"MAX_CONTENT_LENGTH\": null, \n\t  \"PERMANENT_SESSION_LIFETIME\": \"31 days, 0:00:00\", \n\t  \"PORT\": 5000, \n\t  \"PREFERRED_URL_SCHEME\": \"http\", \n\t  \"PRESERVE_CONTEXT_ON_EXCEPTION\": null, \n\t  \"PROPAGATE_EXCEPTIONS\": null, \n\t  \"SECRET_KEY\": \"hide: dc5c40edf6c37edf0a7c615127d435b5aa8d0fcaccef4fde20f190aff81148fd\", \n\t  \"SEND_FILE_MAX_AGE_DEFAULT\": 43200, \n\t  ...\n\t}\n\n\n\nGet site meta\n-------------------\n\n\tGET /admin/meta/meta.json\n\n\n\n.. code-block:: json\n\n\t{\n\t  \"auto_published_comments\": true, \n\t  \"comment_moderation_keys\": [], \n\t  \"description\": \"White is a Blog system\", \n\t  \"posts_per_page\": 10, \n\t  \"site_page\": 0, \n\t  \"sitename\": \"White\"\n\t}\n\n\nGet current user info\n------------------------\n\n\tGET /admin/user.json\n\n.. code-block:: json\n\t\n\t{\n\t  \"bio\": \"\", \n\t  \"email\": \"white@demo.com\", \n\t  \"real_name\": \"White\", \n\t  \"role\": \"root\", \n\t  \"status\": \"active\", \n\t  \"uid\": 1, \n\t  \"username\": \"white\"\n\t}\n\nLICENSE\n=======\n\n    2015 Copyright (C) White\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, version 2 of the License.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhiteclover%2Fwhite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhiteclover%2Fwhite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhiteclover%2Fwhite/lists"}