.. _ref-settings:

==========================
Merengue specific settings
==========================

.. contents::
    :local:
    :depth: 1

Available settings
==================

Here's a full list of all available merengue settings. All these settings are
defined in `merengue/settings.py`_ and can be overriden in your project
settings.

.. _merengue/settings.py: http://tracpub.yaco.es/merengue/browser/trunk/merengueproj/merengue/settings.py


.. setting:: CATCH_STATUS_CODE

HTTP_STATUS_CODE_TEMPLATES
--------------------------

Default: {403: '403.html', 404: '404.html',}

When a HTTP status code (not 500) is found in response, you may want to use an
especific template to render. This is needed in example to catch all permission
error code (403 error).


.. setting:: SITE_FIXTURES

SITE_FIXTURES
-------------

Default: ``{}`` (Empty dictionary)

A dictionary mapping with fixtures to load for every application
It will executed after migrating (with south) models for every application.
Example:

.. code-block:: python

    SITE_FIXTURES = {
        'blog': ('blogs_data.xml', )
        'news': ('news_data.xml', 'news_users.json', )
    }

In this example, after migrate 'news' application Merengue will load
``news_data.xml`` and ``news_users.json``, located in one of `settings.FIXTURE_DIRS`_.

.. _settings.FIXTURE_DIRS: http://docs.djangoproject.com/en/1.3/ref/settings/#fixture-dirs


.. setting:: MERENGUE_URLS_PREFIX

MERENGUE_URLS_PREFIX
--------------------

Default: ``cms``

It will be the prefix for all URLs managed by merengue. Those URLs are defined
in `merengue/urls.py`_ file.

.. _`merengue/urls.py`: http://dev.merengueproject.org/browser/trunk/merengueproj/merengue/urls.py

In your project ``urls.py`` file, merengue URLs are included as follows:

.. code-block:: python

    # merengue URLs
    (r'^%s/' % settings.MERENGUE_URLS_PREFIX, include('merengue.urls')),

You can override this settings if you prefer other prefix than ``cms``.

.. setting:: URL_DEFAULT_LANG

URL_DEFAULT_LANG
----------------

Default: The ``LANGUAGE_CODE`` value

It will say to Merengue what URL will be used in internazionalized URLs.

For example, if you declare a in a plugin ``config.py`` file, a
``url_prefixes`` like that:

.. code-block:: python

    class PluginConfig(Plugin):
        # ... stuff
        url_prefixes = (
            ({'en': 'event', 'es': 'eventos'},
             'plugins.event.urls'),
        )

And your ``URL_DEFAULT_LANG`` is ``"es"``, the ``/eventos`` URL prefix will be
used.

.. setting:: CACHE_BACKEND

CACHE_BACKEND
-------------

Default: ``johnny.backends.locmem:///``

``CACHE_BACKEND`` is not a Merengue settings but a `Django one`_, but we mention
that settings because Merengue uses `Johnny Cache`_ as smart caching manager.

This implies you have to prepend ``johnny.backends.`` to your project caching
backends in order to get it works with ``johnny-cache`` (see
`Johnny Cache backends`_). Example:

.. code-block:: python

    CACHE_BACKEND = 'johnny.backends.memcached://127.0.0.1:11211/'

.. _Django one: http://docs.djangoproject.com/en/1.3/ref/settings/#cache-backend
.. _Johnny Cache: http://packages.python.org/johnny-cache/
.. _Johnny Cache backends: http://packages.python.org/johnny-cache/backends.html


.. setting:: TINYMCE_EXTRA_MEDIA

CACHE_SITE_FOR_ANONYMOUS
------------------------

Default: ``False``

``CACHE_SITE_FOR_ANONYMOUS`` activates the site template caching for anonymous requests. See :ref:`Optimizing a Merengue installation <topics-optimization>`.


TINYMCE_EXTRA_MEDIA
-------------------

Default: ``{ 'js': [], 'css': [] }``

Sometimes is useful for your site add extra CSS or Javascript files inside
Merengue HTML editor (TinyMCE). This would be useful to add your public styles
into HTML editor to be even more WYSIWYG.

You need include all media without ``MEDIA_URL`` prefix. This is an example:

.. code-block:: python

    TINYMCE_EXTRA_MEDIA = {
        'js': [],
        'css': ['themes/yourtheme/css/layout.css'],
    }


.. setting:: PLUGINS_DIR

PLUGINS_DIR
-----------

Default: ``plugins``

This setting defines when Merengue will look the plugins.


.. setting:: REQUIRED_PLUGINS

REQUIRED_PLUGINS
----------------

Default: ``('core', )``

A list with plugins required for the correct behaviour of your project. Those
plugins will be installed and activated when database is created and synced in
your project.


.. setting:: DETECT_NEW_PLUGINS

DETECT_NEW_PLUGINS
------------------

Default: ``True``

Detect automatically new plugins when manager access to plugins admin view.

If ``DETECT_NEW_PLUGINS`` is ``False``, registration of new plugins is done
executing ``register_new_plugins`` command.


.. setting:: DETECT_BROKEN_PLUGINS

DETECT_BROKEN_PLUGINS
---------------------

Default: ``True``

Detect automatically new plugins when manager access to plugins admin view.

If ``DETECT_BROKEN_PLUGINS`` is ``False``, broken plugins detection is done
executing ``mark_broken_plugins`` command.


.. setting:: USE_GIS

USE_GIS
-------

Default: ``False``

Activate GIS in Merengue. This must be defined previously to database creation.


.. setting:: MAP_FILTRABLE_MODELS

MAP_FILTRABLE_MODELS
--------------------

Default: ``('base.basecontent',)``

All models included will be displayed in a filter included in map view, when
GIS is activated.

COMPRESS
--------

Default: ``not DEBUG``

This setting activate/deactivate compression in Javascript and CSS files.
When deployment is done is recommended to activate this variable.

.. note::

    This variable will be activated by default if ``DEBUG`` is ``False``.