Local settings reference

Features versus settings

site feature

An option that can be enabled or disabled for a given Lino site by its site maintainer.

Site features differ technically from site settings: they are more primitive and are being fixed before the lino.ini will be loaded. They are always boolean (enabled or disabled). Every Lino application has a constant list of available features. TODO: explain more.

site setting

A configuration option that can be specified for a given Lino site by its site maintainer, either in the the lino.ini or in the site’s settings.py file.

plugin setting

Similar to site setting, but it exists only when a given plugin is installed.

Some common site settings

The following settings of a Lino site are defined as class attributes of lino.core.site.Site.

languages

The language distribution to be used on this site.

This must be either None, or an iterable of language codes, or a string containing a space-separated series of language codes.

Examples:

languages = "en de fr nl et"
languages = ['en', 'fr']
languages = 'en'

The first language in this list is the site’s default language, returned by get_default_language().

use_help

Whether this site uses lino.modlib.help.

Default value is False.

use_ipdict

Whether this site uses lino.modlib.ipdict.

Default value is False.

Note that lino.modlib.ipdict unlike normal plugins should not be installed by adding it to your get_installed_apps() method but by setting this attribute. This approach has the advantage of also setting MIDDLEWARE_CLASSES automatically.

default_ui

The full Python name of the plugin that acts as main front end on this site.

Default value is lino.modlib.extjs. Other candidates are lino_react.react, lino.modlib.bootstrap3, lino_openui5.openui5, lino_xl.lib.pages and lino_extjs6.extjs6 .

Another possibility is to set it to None. In that case you must probably also set root_urlconf to a custom URL dispatcher.

Advanced site settings

hidden_languages = None

A string with a space-separated list of language codes that should be hidden. This is useful when you have multilingual database content and a language distribution of more than three languages.

webdav_protocol

Set this to a string like e.g. ‘wdav’ to instruct Lino to use this custom protocol instead of http when linking to “editable” printable documents.

See WebDAV.

webdav_url

The URL location for webdav files. In a normal production configuration you should leave this unchanged and Lino will set the default value '/media/webdav/'. You also need to configure your web server to actually serve the files below this location using the WebDAV protocol. See WebDAV.

Obsolete: This may be used to simulate a WebDAV location on a development server. For example on a Windows machine, you may set it to w:\, and before invoking runserver, you issue in a command prompt:

subst w: <dev_project_path>\media\webdav
webdav_root

The path on server to store webdav files. Default is cache_dir + ´/media/webdav’.

custom_layouts_module

The name of the custom layouts module to be used on this site. Default value is defined by the application developer.

workflows_module

The name of the workflows module to be used on this site. Default value is defined by the application developer.

user_types_module

The name of the user types module to be used on this site. Default value is defined by the application developer.

For example:

class Site(Site):
    user_types_module = 'myapp.user_types'
use_security_features = False

Set this to True in order to activate a selection of security features to protect against miscellaneous attacks. You can do this only if your application is being served via HTTPS. The idea is to provide a reasonable security out of the box.

This will activate some middleware and set some security-related settings. This is a new feature and not much tested. As a hoster you may prefer adding security manually using your established standards (regarding security Lino does not add anything to plain Django). See also Security of Lino applications.

root_urlconf = 'lino.core.urls'

The value to be assigned to ROOT_URLCONF when this Site instantiates.

The default value is lino.core.urls.

social_auth_backends = None

A list of backends for Python Social Auth (PSA).

Having this at a value different from None means that this site uses authentication via third-party providers.

Sites which use this feature must also install PSA into their environment (which is done automatically by install).

Depending on the backend you must also add credentials in your local settings.py file, e.g.:

SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = \
  '1234567890-a1b2c3d4e5.apps.googleusercontent.com'
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = 'SH6da...'

A working example is in the lino_book.projects.noi1e demo project.

appy_params

Default value is dict(ooPort=8100, pythonWithUnoPath=’/usr/bin/python3’, raiseOnError=True).

Used by lino_xl.lib.appypod.choicelist.AppyBuildMethod.

Allowed keyword arguments for appy.pod.renderer.Render are:

pythonWithUnoPath=None,
ooPort=2002
stylesMapping={}
forceOoCall=False,
finalizeFunction=None
overwriteExisting=False
raiseOnError=False
imageResolver=None

See the source code for details.

See also Running a LibreOffice server

Custom settings defined by plugins

Activate ElasticSearch: see use_elasticsearch and search.elasticsearch_url.