Gestion de contenu
Go to file
Frédéric Péters 48b09b4105 translation update 2022-04-21 17:55:05 +02:00
combo translation update 2022-04-21 17:55:05 +02:00
debian debian: add python3-distutils dependency, workaround for pyproj (#62269) 2022-02-28 17:59:35 +01:00
tests dataviz: load table charts asynchronously (#64315) 2022-04-20 16:17:52 +02:00
.coveragerc jenkins: show execution context in coverage reports (#60446) 2022-01-11 15:22:24 +01:00
.git-blame-ignore-revs misc: add pyupgrade files/notes (#55868) 2021-07-27 16:46:20 +02:00
.gitignore misc: git ignore combo.manager.css 2022-04-15 09:14:50 +02:00
.pre-commit-config.yaml trivial: bump black version to 22.3.0 2022-03-31 12:16:57 +02:00
COPYING add license file 2014-12-07 15:01:15 +01:00
Jenkinsfile jenkins: build packages for buster & bullseye 2021-12-03 15:25:22 +01:00
MANIFEST.in misc: switch manager to scss (#62306) 2022-03-01 15:06:37 +01:00
README misc: add pyupgrade files/notes (#55868) 2021-07-27 16:46:20 +02:00
getlasso3.sh tox: load lasso (#35425) 2019-08-18 14:46:56 +02:00
manage.py debian: switch to Python 3 (#36233) 2019-10-13 15:41:19 +02:00
pylint.rc pylint: disable use-implicit-booleaness-not-comparison (same as #59021) 2021-11-25 21:09:26 +01:00
pylint.sh build: make it fail in case of pylint warnings (#56288) 2021-08-31 10:00:38 +02:00
requirements.txt trivial: limit psycopg2 as django<2.3 doesn't work with newer versions (#61712) 2022-02-12 12:42:53 +01:00
setup.py build: add missing CompileError import (#62938) 2022-03-18 13:17:06 +01:00
tox.ini tox: move pylint to separate environment (#61493) 2022-02-14 09:55:43 +01:00

README

Combo
=====

Combo is a simple content management system, tailored to create simple
websites, and with a specialization in aggregating contents from different
sources.

Installation
------------

Dependencies can be installed with pip,

 $ pip install -r requirements.txt

It's then required to get the database configured (./manage.py migrate); by
default it will create a postgresqsl DB.

You can then run the Django test server for a quick try (you should refer to
the Django documentation for production deployments).

 $ ./manage.py runserver


Architecture
------------

Combo manages content as a series of pages (objects of type 'Page'), that can
be sorted ('order' attribute) and hierarchically ordered ('parent' attribute).

Every pages have a title and a "slug", that is used as the page URL; a page
with 'index' as its slug will be served as the index page of the site.

The pages are set to use a template; the templates are defined in the settings
file (COMBO_PUBLIC_TEMPLATES) and are made of a name, a template file, and a
serie of "placeholders", identifying locations in the page (main content, side
bar, footer...).

Example:

    'standard': {
        'name': 'Standard',
        'template': 'combo/page_template.html',
        'placeholders': {
            'content': {
                'name': 'Content',
            },
            'footer': {
                'name': 'Footer',
                'acquired': True,
            },
        }
    }

The content of a page is defined as a serie of cells, of which there are
various types (they are all subclasses of CellBase); each cell is also
associated with a placeholder ('placeholder' attribute) and its order within
('order' attribute).

A placeholder can be marked as 'acquired' (see "footer" in the example above),
this way a cell of "same as parent" type will automatically be added.


Settings
--------

Default settings are loaded from settings.py, they can be overloaded by a
local_settings.py file set in the same directory, or by a file referenced
in the COMBO_SETTINGS_FILE environment variable.

SAML authentication can be enabled by adding 'mellon' to INSTALLED_APPS and
'mellon.backends.SAMLBackend' to AUTHENTICATION_BACKENDS, this requires
django-mellon to be installed, and further files and settings are required:

 - public and private keys (in cert.pem and key.cert in the current working
   directory, or from files defined in the MELLON_PUBLIC_KEYS and
   MELLON_PRIVATE_KEY settings)
 - metadata of the identity provider (in idp-metadata.xml, or defined using
   the MELLON_IDENTITY_PROVIDERS settings)

Details on these options and additional SAML settings are available in the
documentation of django-mellon.


Tests
-----

Unit tests are written using py.test, and its pytest-django support library.

  DJANGO_SETTINGS_MODULE=combo.settings COMBO_SETTINGS_FILE=tests/settings.py py.test


Code Style
----------

black is used to format the code, using thoses parameters:

    black --target-version py37 --skip-string-normalization --line-length 110

isort is used to format the imports, using those parameters:

    isort --profile black --line-length 110

pyupgrade is used to automatically upgrade syntax, using those parameters:

    pyupgrade --keep-percent-format --py37-plus

There is .pre-commit-config.yaml to use pre-commit to automatically run black,
isort and pyupgrade before commits. (execute `pre-commit install` to install
the git hook.)


License
-------

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
details.

You should have received a copy of the GNU Affero General Public License along
with this program.  If not, see <http://www.gnu.org/licenses/>.


Combo embeds some other pieces of code, with their own authors and copyright
notices:

Gauge.js
  Files: combo/apps/dataviz/static/js/gauge.min.js
  License: MIT
  Comment:
   From http://bernii.github.io/gauge.js/

Pygal.tooltip.js
  Files: combo/apps/dataviz/static/js/pygal.tooltip.js
  Copyright: 2015, Florian Mounier Kozea
  License: LGPL-3+
  Comment:
   From https://github.com/Kozea/pygal.js/