coldcms


Namecoldcms JSON
Version 0.2.9 PyPI version JSON
download
home_pagehttps://coldcms.hashbang.fr
SummaryA CMS optimized for low consumption
upload_time2023-12-08 10:57:39
maintainer
docs_urlNone
authorHashbang
requires_python
licenseGNU AFFERO GENERAL PUBLIC LICENSE version 3
keywords cms django wagtail performance ecology
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =======
ColdCMS
=======

.. image:: coldcms/static/svg/coldcms.svg
    :width: 100
    :height: 100
    :alt: ColdCMS logo

.. image:: https://badge.fury.io/py/coldcms.svg

.. image:: https://readthedocs.org/projects/pip/badge/

.. image:: https://gitlab.com/hashbangfr/coldcms/badges/master/pipeline.svg

.. image:: https://gitlab.com/hashbangfr/coldcms/badges/master/coverage.svg


Goal
====

A fully functional CMS optimized for low consumption.

`Read blog posts <https://coldcms.hashbang.fr>`_ about this.


Benchmark
=========

`Benchmark details to Coldcms <https://gitlab.com/hashbangfr/coldcms/-/blob/master/benchmark/README.rst>`_


Description
===========
ColdCMS is a `Django <https://www.djangoproject.com>`_ project based on `Wagtail CMS <https://wagtail.io>`_ and `Bulma <https://bulma.io>`_
CSS framework.

The admin can edit websites through an intuitive and user-friendly interface. Different types of pages are pre-designed, making it possible
to have a nice-looking website without spending hours on it.

ColdCMS is especially designed for people who want to reduce the impact of their use of digital technologies on the environnement.

The client website consists of static pages, built with `Wagtail bakery <https://github.com/wagtail/wagtail-bakery>`_. The website pages
are generated and updated when necessary (e.g. when the admin publishes or modifies content).

Among other optimizations, the size of CSS files is reduced and unused CSS code is removed, using
`PurgeCSS <https://github.com/FullHuman/purgecss>`_ and `clean-css <https://github.com/jakubpawlowicz/clean-css-cli>`_.

ColdCMS supports Python >= 3.6.


How to use ColdCMS?
===================

You have access to a ColdCMS instance and you want to create a website
----------------------------------------------------------------------

You can find the user documentation here:

- `English documentation <https://coldcms.readthedocs.io/en/latest/>`_
- `Documentation en français <https://coldcms.readthedocs.io/fr/latest/>`_

You want to install ColdCMS
---------------------------

You have two options: docker installation or manual installation.

Docker installation
```````````````````

You will need docker-compose and docker with a running daemon.

We provide a sample ``docker/docker-compose.yml`` file. Feel free to modify it for your needs.

.. code-block:: shell

    cd docker && docker-compose up

Here are some env variables that you might want to change:

* ``POSTGRES_USER``, ``POSTGRES_PASSWORD``, ``POSTGRES_DB`` see
  `<https://github.com/docker-library/docs/blob/master/postgres/README.md#environment-variables>`_
* ``DB_URL``, the database connection URL, see `<https://github.com/jacobian/dj-database-url#url-schema>`_
* ``SECRET_KEY``, the `Django SECRET_KEY <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SECRET_KEY>`__,
  it should be a private, 40-character long randomly-generated string
* ``ALLOWED_HOSTS``, the coma-separated list of hosts allowed to serve your application, corresponds to the
  `Django ALLOWED_HOSTS <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-ALLOWED_HOSTS>`__

You can then create an admin user which will have access to http://localhost/admin

.. code-block:: shell

    docker exec -it docker_backend_1 python3 manage.py createsuperuser

Manual installation
```````````````````

1. Choose a database
....................

We recommend using ``PostgreSQL``, but you can also use the default ``SQLite`` (no setup required). If you choose to use ``PostgreSQL``
take note of the host, port, database, user, and password you're using.

2. Install the backend part of ColdCMS
......................................

The backend is used to modify your website, it's located on ``https://your-site.tld/admin``

Download the latest release available here: https://gitlab.com/hashbangfr/coldcms/-/releases (or ``git clone`` the project, as you want)

Then you'll need to launch the ``wsgi`` application located here: https://gitlab.com/hashbangfr/coldcms/-/blob/master/coldcms/wsgi.py

You can do this using several projects:

- `uwsgi <http://uwsgi-docs.readthedocs.org/en/latest/>`_ (our preferred approach)
- `mod_wsgi (apache) <https://github.com/GrahamDumpleton/mod_wsgi>`_
- `CherryPy <https://github.com/cherrypy/cherrypy>`_
- and so on..

You'll have to pass some environment variables to the wsgi process (uwsgi for example), for the application to work as expected:

- ``DB_URL=postgres://coldcms:coldcms@db_host:5432/coldcms`` # adapt this for your setup, if you choose to use ``SQLite`` you can omit it
- ``BUILD_DIR=/srv/build`` # the directory under which the generated website will go,
  this directory will be served by your webserver (ex: nginx)
- ``STATIC_ROOT=/srv/build/static/`` # `Django STATIC_ROOT <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-STATIC_ROOT>`__
  this directory needs to be served by your file server (ex: nginx) as well
- ``SECRET_KEY=CHANGE_ME`` # `Django SECRET_KEY <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SECRET_KEY>`__
  it should be a private, 40-character long randomly-generated string
- ``ALLOWED_HOSTS=localhost,127.0.0.1,your-domain.tld``, the coma-separated list of hosts allowed to serve your application, corresponds to the
  `Django ALLOWED_HOSTS <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-ALLOWED_HOSTS>`__

Here is a working example using ``uwsgi``, with the application located under ``/srv/app`` and using ``SQLite``:

.. code-block:: yaml

    [uwsgi]
    socket = 0.0.0.0:8000
    chdir = /srv/app/
    module = coldcms.wsgi:application
    master = true
    processes = 4
    threads = 2
    uid = coldcms
    gid = coldcms
    buffer-size = 65535
    env = BUILD_DIR=/srv/build
    env = STATIC_ROOT=/srv/build/static/
    env = SECRET_KEY=something_big_and_random


3. Setup Nginx to work with the backend
.......................................

Nginx acts like a file server which serves the static website generated by the backend. You can choose any kind of file server as long as
it can :

- serve files efficiently (HTML / images / assets ...)
- proxy requests to ``/admin`` to the actual ColdCMS backend (set up on the 2nd step)

An example of a functional nginx config is available here:
https://gitlab.com/hashbangfr/coldcms/-/blob/manual-install-doc/docker/nginx/nginx.conf

4 locations need to be served:

- ``/admin`` -> proxy to the python ColdCMS backend (step 2)
- ``/`` -> serve the HTML files generated by the backend (see ``BUILD_DIR`` in step 2)
- ``/media`` -> serve the medias files uploaded by the admin (it corresponds to ``$BUILD_DIR/media``)
- ``/static`` -> serve the static files (see ``STATIC_ROOT`` in step 2)

Feel free to adapt it for your needs

You are a developer and you want to quickly have a look
--------------------------------------------------------

**Note:** this has only been tested on Linux environments.

Install ColdCMS with pypi:

.. code-block:: shell

    pip install coldcms

Run the quick launch command:

.. code-block:: shell

    python -m coldcms

Before this command you can set the following environment variables :

- ``RUN_DJANGO_MIGRATION=0``: do not run the migrations

- ``SETUP_INITIAL_DATA=0``: do not setup the initial data, in case you want to keep the data you already have in your coldcms database

- ``COLLECT_STATIC=0``: do not collect the static files. Don't set that variable to 0 if it is your first time launching ColdCMS.

- ``CREATE_SUPERUSER=0``: do not create a new superuser (you can have several superuser at a time, but not with the same username or email)

- ``BUILD_ASSETS=0``: do not build build assets. Don't set that variable to 0 if it is your first time launching ColdCMS.

- ``BUILD_STATIC=0``: do not build static files. Don't set that variable to 0 if you've also set SETUP_INITIAL_DATA to 0.

Example: ``CREATE_SUPERUSER=0 python -m coldcms`` will run the migrations, setup some new initial data, but will not create a new superuser.

You are a developer and you want to contribute to ColdCMS
---------------------------------------------------------

Clone the gitlab repository, and read the **Dev** section below to install the ColdCMS development environment.

Follow the `contribution guidelines <https://gitlab.com/hashbangfr/coldcms/-/blob/master/CONTRIBUTING.rst>`_.

Dev
===

**Note:** this has only been tested on Linux environments.

1. Install the dependencies
---------------------------

Install ``libjpeg`` and ``zlib``, needed to work with images through the ``Pillow`` library.
If you have a debian-based distribution, use the following commands:

.. code-block:: shell

    sudo apt-get install zlib1g-dev
    sudo apt-get install libjpeg-dev

Also, please install PurgeCSS and clean-css, to reduce the size of CSS files:

.. code-block:: shell

    npm install -g purgecss@2.1.0 clean-css-cli@4.3.0

And to continue with javascript, please install static dependencies :

.. code-block:: shell

    (cd coldcms/static/ && npm i --save-dev)

We use sass to transpile sass files to CSS. Make sure that the binary `sass` from the `sassc` package is present in your $PATH.
In debian-based distributions, run the following:

.. code-block:: shell

    sudo apt-get install sassc
    sudo ln -s /usr/bin/sassc /usr/bin/sass # might be necessary if /usr/bin/sass doesn't exist after the previous command

Finally, run:

.. code-block:: shell

    pip install -r requirements_dev.txt


2. Create a database
--------------------

By default, ``./manage.py migrate`` will create a sqlite3 database named ``coldcms``.

- If you want to use a different database engine, you can specify it in the environment variable ``DB_URL``. Make sure you have the
  proper database driver for the engine you want to use.
- If you want to use a different name for your sqlite database, you can specify it in the environment variable ``DB_NAME``
  (useless for some engines as it is directly specified in the url - see table below).

As advised in the `django documentation <https://docs.djangoproject.com/en/3.0/intro/tutorial02/#database-setup>`_, if you’re new to
databases, or you’re just interested in trying ColdCMS, use the default sqlite3 database, it is included in Python, so you won’t need to
install anything else to support your database. When starting your first real project, however, you may want to use a more scalable
database like PostgreSQL, to avoid database-switching headaches down the road.

+-------------+--------------------------------------------------+
| Engine      | DB_URL                                           |
+=============+==================================================+
| PostgreSQL  | ``postgres://USER:PASSWORD@HOST:PORT/NAME``      |
+-------------+--------------------------------------------------+
| PostGIS     | ``postgis://USER:PASSWORD@HOST:PORT/NAME``       |
+-------------+--------------------------------------------------+
| MSSQL       | ``mssql://USER:PASSWORD@HOST:PORT/NAME``         |
+-------------+--------------------------------------------------+
| MySQL       | ``mysql://USER:PASSWORD@HOST:PORT/NAME``         |
+-------------+--------------------------------------------------+
| MySQL (GIS) | ``mysqlgis://USER:PASSWORD@HOST:PORT/NAME``      |
+-------------+--------------------------------------------------+
| SQLite      | ``sqlite:///PATH``                               |
+-------------+--------------------------------------------------+
| SpatiaLite  | ``spatialite:///PATH``                           |
+-------------+--------------------------------------------------+
| Oracle      | ``oracle://USER:PASSWORD@HOST:PORT/NAME``        |
+-------------+--------------------------------------------------+
| Oracle (GIS)| ``oraclegis://USER:PASSWORD@HOST:PORT/NAME``     |
+-------------+--------------------------------------------------+
| Redshift    | ``redshift://USER:PASSWORD@HOST:PORT/NAME``      |
+-------------+--------------------------------------------------+

Replace PATH, USER, PASSWORD, HOST, PORT and NAME with the correct values.

`Source <https://github.com/jacobian/dj-database-url/blob/master/README.rst>`_

For example, if you want to use PostgreSQL :

.. code-block:: shell

    systemctl status postgresql # make sure postgresql is running
    createdb coldcms # create the coldcms postgres database
    sudo -u postgres psql
    CREATE USER username PASSWORD 'password';
    ALTER ROLE username WITH SUPERUSER;
    \q
    export DB_URL="postgres://username:password@localhost:5432/coldcms"


3. Launch the development server
--------------------------------

.. code-block:: shell

    ./manage.py migrate
    ./manage.py collectstatic
    ./manage.py compilemessages
    ./manage.py createsuperuser
    ./manage.py setup_initial_data # optional - loads data of a basic home page
    ./manage.py runserver


If collectstatic doesn't work, try :

.. code-block:: shell

    cd coldcms/static && npm i
    cd ../.. && ./manage.py assets build


Custom theme for ColdCMS?
==========================

You can override coldcms style with your own theme.

You can create a Theme with the following command :

.. code-block:: shell

    ./manage.py collecttheme <theme>

That will create a directory theme at coldcms root.
You can also create this directory everywhere you want. This directory must have the following structure

::

    <theme>
    ├── static
    │   ├── scss
    │   │   └── <theme>.scss
    |   |   └── theme_variables.scss
    │   └── svg
    └── templates


You have to set theme name and theme directory as environment variables

- THEME for theme name
- THEME_DIR for path to theme directory


There is also an option to customize the theme path :

.. code-block:: shell

    ./manage.py collecttheme <theme> --directory=<path>

To override a specific template, in the templates directory of your theme, add the directory


To override a specific template file, in the "templates" folder of your theme, you need to add a folder named like the original folder containing the template file. Then you must create the template file with the same name as well.

Example :

**Original struct** :

::

     generic_page <app>
     └── templates
         └── generic_page
             └── generic_page.html


**In your theme** :

::

     <theme>
     └── templates
         └── generic_page
             └── generic_page.html


Finally, for the surcharge to be properly applied, you will need to define the name and path of your theme.
In the settings/base.py file there are the global variables "THEME" and "THEME_DIR" provided for this purpose.
If you do not want to modify the settings.py file, you can define these variables with the terminal :

.. code-block:: shell

    export THEME=<theme>
    export THEME_DIR=<path theme>


            

Raw data

            {
    "_id": null,
    "home_page": "https://coldcms.hashbang.fr",
    "name": "coldcms",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "cms,django,wagtail,performance,ecology",
    "author": "Hashbang",
    "author_email": "contact@hashbang.fr",
    "download_url": "https://files.pythonhosted.org/packages/f0/a8/b9df0fdb0164a21feb374b8d38737a0f39fcff0fdf7bf3c36bbc7fc0725f/coldcms-0.2.9.tar.gz",
    "platform": null,
    "description": "=======\nColdCMS\n=======\n\n.. image:: coldcms/static/svg/coldcms.svg\n    :width: 100\n    :height: 100\n    :alt: ColdCMS logo\n\n.. image:: https://badge.fury.io/py/coldcms.svg\n\n.. image:: https://readthedocs.org/projects/pip/badge/\n\n.. image:: https://gitlab.com/hashbangfr/coldcms/badges/master/pipeline.svg\n\n.. image:: https://gitlab.com/hashbangfr/coldcms/badges/master/coverage.svg\n\n\nGoal\n====\n\nA fully functional CMS optimized for low consumption.\n\n`Read blog posts <https://coldcms.hashbang.fr>`_ about this.\n\n\nBenchmark\n=========\n\n`Benchmark details to Coldcms <https://gitlab.com/hashbangfr/coldcms/-/blob/master/benchmark/README.rst>`_\n\n\nDescription\n===========\nColdCMS is a `Django <https://www.djangoproject.com>`_ project based on `Wagtail CMS <https://wagtail.io>`_ and `Bulma <https://bulma.io>`_\nCSS framework.\n\nThe admin can edit websites through an intuitive and user-friendly interface. Different types of pages are pre-designed, making it possible\nto have a nice-looking website without spending hours on it.\n\nColdCMS is especially designed for people who want to reduce the impact of their use of digital technologies on the environnement.\n\nThe client website consists of static pages, built with `Wagtail bakery <https://github.com/wagtail/wagtail-bakery>`_. The website pages\nare generated and updated when necessary (e.g. when the admin publishes or modifies content).\n\nAmong other optimizations, the size of CSS files is reduced and unused CSS code is removed, using\n`PurgeCSS <https://github.com/FullHuman/purgecss>`_ and `clean-css <https://github.com/jakubpawlowicz/clean-css-cli>`_.\n\nColdCMS supports Python >= 3.6.\n\n\nHow to use ColdCMS?\n===================\n\nYou have access to a ColdCMS instance and you want to create a website\n----------------------------------------------------------------------\n\nYou can find the user documentation here:\n\n- `English documentation <https://coldcms.readthedocs.io/en/latest/>`_\n- `Documentation en fran\u00e7ais <https://coldcms.readthedocs.io/fr/latest/>`_\n\nYou want to install ColdCMS\n---------------------------\n\nYou have two options: docker installation or manual installation.\n\nDocker installation\n```````````````````\n\nYou will need docker-compose and docker with a running daemon.\n\nWe provide a sample ``docker/docker-compose.yml`` file. Feel free to modify it for your needs.\n\n.. code-block:: shell\n\n    cd docker && docker-compose up\n\nHere are some env variables that you might want to change:\n\n* ``POSTGRES_USER``, ``POSTGRES_PASSWORD``, ``POSTGRES_DB`` see\n  `<https://github.com/docker-library/docs/blob/master/postgres/README.md#environment-variables>`_\n* ``DB_URL``, the database connection URL, see `<https://github.com/jacobian/dj-database-url#url-schema>`_\n* ``SECRET_KEY``, the `Django SECRET_KEY <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SECRET_KEY>`__,\n  it should be a private, 40-character long randomly-generated string\n* ``ALLOWED_HOSTS``, the coma-separated list of hosts allowed to serve your application, corresponds to the\n  `Django ALLOWED_HOSTS <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-ALLOWED_HOSTS>`__\n\nYou can then create an admin user which will have access to http://localhost/admin\n\n.. code-block:: shell\n\n    docker exec -it docker_backend_1 python3 manage.py createsuperuser\n\nManual installation\n```````````````````\n\n1. Choose a database\n....................\n\nWe recommend using ``PostgreSQL``, but you can also use the default ``SQLite`` (no setup required). If you choose to use ``PostgreSQL``\ntake note of the host, port, database, user, and password you're using.\n\n2. Install the backend part of ColdCMS\n......................................\n\nThe backend is used to modify your website, it's located on ``https://your-site.tld/admin``\n\nDownload the latest release available here: https://gitlab.com/hashbangfr/coldcms/-/releases (or ``git clone`` the project, as you want)\n\nThen you'll need to launch the ``wsgi`` application located here: https://gitlab.com/hashbangfr/coldcms/-/blob/master/coldcms/wsgi.py\n\nYou can do this using several projects:\n\n- `uwsgi <http://uwsgi-docs.readthedocs.org/en/latest/>`_ (our preferred approach)\n- `mod_wsgi (apache) <https://github.com/GrahamDumpleton/mod_wsgi>`_\n- `CherryPy <https://github.com/cherrypy/cherrypy>`_\n- and so on..\n\nYou'll have to pass some environment variables to the wsgi process (uwsgi for example), for the application to work as expected:\n\n- ``DB_URL=postgres://coldcms:coldcms@db_host:5432/coldcms`` # adapt this for your setup, if you choose to use ``SQLite`` you can omit it\n- ``BUILD_DIR=/srv/build`` # the directory under which the generated website will go,\n  this directory will be served by your webserver (ex: nginx)\n- ``STATIC_ROOT=/srv/build/static/`` # `Django STATIC_ROOT <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-STATIC_ROOT>`__\n  this directory needs to be served by your file server (ex: nginx) as well\n- ``SECRET_KEY=CHANGE_ME`` # `Django SECRET_KEY <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SECRET_KEY>`__\n  it should be a private, 40-character long randomly-generated string\n- ``ALLOWED_HOSTS=localhost,127.0.0.1,your-domain.tld``, the coma-separated list of hosts allowed to serve your application, corresponds to the\n  `Django ALLOWED_HOSTS <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-ALLOWED_HOSTS>`__\n\nHere is a working example using ``uwsgi``, with the application located under ``/srv/app`` and using ``SQLite``:\n\n.. code-block:: yaml\n\n    [uwsgi]\n    socket = 0.0.0.0:8000\n    chdir = /srv/app/\n    module = coldcms.wsgi:application\n    master = true\n    processes = 4\n    threads = 2\n    uid = coldcms\n    gid = coldcms\n    buffer-size = 65535\n    env = BUILD_DIR=/srv/build\n    env = STATIC_ROOT=/srv/build/static/\n    env = SECRET_KEY=something_big_and_random\n\n\n3. Setup Nginx to work with the backend\n.......................................\n\nNginx acts like a file server which serves the static website generated by the backend. You can choose any kind of file server as long as\nit can :\n\n- serve files efficiently (HTML / images / assets ...)\n- proxy requests to ``/admin`` to the actual ColdCMS backend (set up on the 2nd step)\n\nAn example of a functional nginx config is available here:\nhttps://gitlab.com/hashbangfr/coldcms/-/blob/manual-install-doc/docker/nginx/nginx.conf\n\n4 locations need to be served:\n\n- ``/admin`` -> proxy to the python ColdCMS backend (step 2)\n- ``/`` -> serve the HTML files generated by the backend (see ``BUILD_DIR`` in step 2)\n- ``/media`` -> serve the medias files uploaded by the admin (it corresponds to ``$BUILD_DIR/media``)\n- ``/static`` -> serve the static files (see ``STATIC_ROOT`` in step 2)\n\nFeel free to adapt it for your needs\n\nYou are a developer and you want to quickly have a look\n--------------------------------------------------------\n\n**Note:** this has only been tested on Linux environments.\n\nInstall ColdCMS with pypi:\n\n.. code-block:: shell\n\n    pip install coldcms\n\nRun the quick launch command:\n\n.. code-block:: shell\n\n    python -m coldcms\n\nBefore this command you can set the following environment variables :\n\n- ``RUN_DJANGO_MIGRATION=0``: do not run the migrations\n\n- ``SETUP_INITIAL_DATA=0``: do not setup the initial data, in case you want to keep the data you already have in your coldcms database\n\n- ``COLLECT_STATIC=0``: do not collect the static files. Don't set that variable to 0 if it is your first time launching ColdCMS.\n\n- ``CREATE_SUPERUSER=0``: do not create a new superuser (you can have several superuser at a time, but not with the same username or email)\n\n- ``BUILD_ASSETS=0``: do not build build assets. Don't set that variable to 0 if it is your first time launching ColdCMS.\n\n- ``BUILD_STATIC=0``: do not build static files. Don't set that variable to 0 if you've also set SETUP_INITIAL_DATA to 0.\n\nExample: ``CREATE_SUPERUSER=0 python -m coldcms`` will run the migrations, setup some new initial data, but will not create a new superuser.\n\nYou are a developer and you want to contribute to ColdCMS\n---------------------------------------------------------\n\nClone the gitlab repository, and read the **Dev** section below to install the ColdCMS development environment.\n\nFollow the `contribution guidelines <https://gitlab.com/hashbangfr/coldcms/-/blob/master/CONTRIBUTING.rst>`_.\n\nDev\n===\n\n**Note:** this has only been tested on Linux environments.\n\n1. Install the dependencies\n---------------------------\n\nInstall ``libjpeg`` and ``zlib``, needed to work with images through the ``Pillow`` library.\nIf you have a debian-based distribution, use the following commands:\n\n.. code-block:: shell\n\n    sudo apt-get install zlib1g-dev\n    sudo apt-get install libjpeg-dev\n\nAlso, please install PurgeCSS and clean-css, to reduce the size of CSS files:\n\n.. code-block:: shell\n\n    npm install -g purgecss@2.1.0 clean-css-cli@4.3.0\n\nAnd to continue with javascript, please install static dependencies :\n\n.. code-block:: shell\n\n    (cd coldcms/static/ && npm i --save-dev)\n\nWe use sass to transpile sass files to CSS. Make sure that the binary `sass` from the `sassc` package is present in your $PATH.\nIn debian-based distributions, run the following:\n\n.. code-block:: shell\n\n    sudo apt-get install sassc\n    sudo ln -s /usr/bin/sassc /usr/bin/sass # might be necessary if /usr/bin/sass doesn't exist after the previous command\n\nFinally, run:\n\n.. code-block:: shell\n\n    pip install -r requirements_dev.txt\n\n\n2. Create a database\n--------------------\n\nBy default, ``./manage.py migrate`` will create a sqlite3 database named ``coldcms``.\n\n- If you want to use a different database engine, you can specify it in the environment variable ``DB_URL``. Make sure you have the\n  proper database driver for the engine you want to use.\n- If you want to use a different name for your sqlite database, you can specify it in the environment variable ``DB_NAME``\n  (useless for some engines as it is directly specified in the url - see table below).\n\nAs advised in the `django documentation <https://docs.djangoproject.com/en/3.0/intro/tutorial02/#database-setup>`_, if you\u2019re new to\ndatabases, or you\u2019re just interested in trying ColdCMS, use the default sqlite3 database, it is included in Python, so you won\u2019t need to\ninstall anything else to support your database. When starting your first real project, however, you may want to use a more scalable\ndatabase like PostgreSQL, to avoid database-switching headaches down the road.\n\n+-------------+--------------------------------------------------+\n| Engine      | DB_URL                                           |\n+=============+==================================================+\n| PostgreSQL  | ``postgres://USER:PASSWORD@HOST:PORT/NAME``      |\n+-------------+--------------------------------------------------+\n| PostGIS     | ``postgis://USER:PASSWORD@HOST:PORT/NAME``       |\n+-------------+--------------------------------------------------+\n| MSSQL       | ``mssql://USER:PASSWORD@HOST:PORT/NAME``         |\n+-------------+--------------------------------------------------+\n| MySQL       | ``mysql://USER:PASSWORD@HOST:PORT/NAME``         |\n+-------------+--------------------------------------------------+\n| MySQL (GIS) | ``mysqlgis://USER:PASSWORD@HOST:PORT/NAME``      |\n+-------------+--------------------------------------------------+\n| SQLite      | ``sqlite:///PATH``                               |\n+-------------+--------------------------------------------------+\n| SpatiaLite  | ``spatialite:///PATH``                           |\n+-------------+--------------------------------------------------+\n| Oracle      | ``oracle://USER:PASSWORD@HOST:PORT/NAME``        |\n+-------------+--------------------------------------------------+\n| Oracle (GIS)| ``oraclegis://USER:PASSWORD@HOST:PORT/NAME``     |\n+-------------+--------------------------------------------------+\n| Redshift    | ``redshift://USER:PASSWORD@HOST:PORT/NAME``      |\n+-------------+--------------------------------------------------+\n\nReplace PATH, USER, PASSWORD, HOST, PORT and NAME with the correct values.\n\n`Source <https://github.com/jacobian/dj-database-url/blob/master/README.rst>`_\n\nFor example, if you want to use PostgreSQL :\n\n.. code-block:: shell\n\n    systemctl status postgresql # make sure postgresql is running\n    createdb coldcms # create the coldcms postgres database\n    sudo -u postgres psql\n    CREATE USER username PASSWORD 'password';\n    ALTER ROLE username WITH SUPERUSER;\n    \\q\n    export DB_URL=\"postgres://username:password@localhost:5432/coldcms\"\n\n\n3. Launch the development server\n--------------------------------\n\n.. code-block:: shell\n\n    ./manage.py migrate\n    ./manage.py collectstatic\n    ./manage.py compilemessages\n    ./manage.py createsuperuser\n    ./manage.py setup_initial_data # optional - loads data of a basic home page\n    ./manage.py runserver\n\n\nIf collectstatic doesn't work, try :\n\n.. code-block:: shell\n\n    cd coldcms/static && npm i\n    cd ../.. && ./manage.py assets build\n\n\nCustom theme for ColdCMS?\n==========================\n\nYou can override coldcms style with your own theme.\n\nYou can create a Theme with the following command :\n\n.. code-block:: shell\n\n    ./manage.py collecttheme <theme>\n\nThat will create a directory theme at coldcms root.\nYou can also create this directory everywhere you want. This directory must have the following structure\n\n::\n\n    <theme>\n    \u251c\u2500\u2500 static\n    \u2502   \u251c\u2500\u2500 scss\n    \u2502   \u2502   \u2514\u2500\u2500 <theme>.scss\n    |   |   \u2514\u2500\u2500 theme_variables.scss\n    \u2502   \u2514\u2500\u2500 svg\n    \u2514\u2500\u2500 templates\n\n\nYou have to set theme name and theme directory as environment variables\n\n- THEME for theme name\n- THEME_DIR for path to theme directory\n\n\nThere is also an option to customize the theme path :\n\n.. code-block:: shell\n\n    ./manage.py collecttheme <theme> --directory=<path>\n\nTo override a specific template, in the templates directory of your theme, add the directory\n\n\nTo override a specific template file, in the \"templates\" folder of your theme, you need to add a folder named like the original folder containing the template file. Then you must create the template file with the same name as well.\n\nExample :\n\n**Original struct** :\n\n::\n\n     generic_page <app>\n     \u2514\u2500\u2500 templates\n         \u2514\u2500\u2500 generic_page\n             \u2514\u2500\u2500 generic_page.html\n\n\n**In your theme** :\n\n::\n\n     <theme>\n     \u2514\u2500\u2500 templates\n         \u2514\u2500\u2500 generic_page\n             \u2514\u2500\u2500 generic_page.html\n\n\nFinally, for the surcharge to be properly applied, you will need to define the name and path of your theme.\nIn the settings/base.py file there are the global variables \"THEME\" and \"THEME_DIR\" provided for this purpose.\nIf you do not want to modify the settings.py file, you can define these variables with the terminal :\n\n.. code-block:: shell\n\n    export THEME=<theme>\n    export THEME_DIR=<path theme>\n\n",
    "bugtrack_url": null,
    "license": "GNU AFFERO GENERAL PUBLIC LICENSE version 3",
    "summary": "A CMS optimized for low consumption",
    "version": "0.2.9",
    "project_urls": {
        "Code": "https://gitlab.com/hashbangfr/coldcms",
        "Documentation": "https://coldcms.readthedocs.io/en/latest/",
        "Homepage": "https://coldcms.hashbang.fr"
    },
    "split_keywords": [
        "cms",
        "django",
        "wagtail",
        "performance",
        "ecology"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f0a8b9df0fdb0164a21feb374b8d38737a0f39fcff0fdf7bf3c36bbc7fc0725f",
                "md5": "f46d3d1dd1b10a9c0ba6b41d6b5f5baa",
                "sha256": "74a7562c3e8297e24f5d075b22ab022b9e885e33c66f0d6f43c62faf00de1ec1"
            },
            "downloads": -1,
            "filename": "coldcms-0.2.9.tar.gz",
            "has_sig": false,
            "md5_digest": "f46d3d1dd1b10a9c0ba6b41d6b5f5baa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4849904,
            "upload_time": "2023-12-08T10:57:39",
            "upload_time_iso_8601": "2023-12-08T10:57:39.364752Z",
            "url": "https://files.pythonhosted.org/packages/f0/a8/b9df0fdb0164a21feb374b8d38737a0f39fcff0fdf7bf3c36bbc7fc0725f/coldcms-0.2.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-08 10:57:39",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "hashbangfr",
    "gitlab_project": "coldcms",
    "lcname": "coldcms"
}
        
Elapsed time: 0.43137s