Skip to content

Latest commit

 

History

History
56 lines (41 loc) · 1.9 KB

config.rst

File metadata and controls

56 lines (41 loc) · 1.9 KB

Configuration

Settings that need to be set in settings.py.

HX_REQUESTS_CUSTOM_VIEWS_SETUP : Default=None
Dict of custom views to a corrensponding get function that mimics the view's get EXCEPT that it does not return a response (see :ref:`Context setup by get`.)
For example:
HX_REQUESTS_CUSTOM_VIEWS_SETUP = {
    'my_app.views.my_custom_view': 'my_app.view_get_functions.custom_view_get',
}

Messages Configuration

HX_REQUESTS_USE_HX_MESSAGES : Default=False
Set this to True to use hx-requests messaging framework. If this is False hx-requests messages will not be displayed even if you set messages.
HX_REQUESTS_USE_DJANGO_MESSAGE_TAGS : Default=False
Set this to True to use Django's MESSAGE_TAGS setting for tags.
HX_REQUESTS_HX_MESSAGE_TAGS : No Default
If you are not using Django's MESSAGE_TAGS set this to a dict of tags.

Example
MESSAGE_TAGS = {
messages.DEBUG: "alert-info",
messages.INFO: "alert-info",
messages.SUCCESS: "alert-success",
messages.WARNING: "alert-warning",
messages.ERROR: "alert-danger",
}
HX_REQUESTS_HX_MESSAGES_TEMPLATE : No Default

Template to be used for displaying the messages. The context in this template has access to the messages.

Modal Configuration

Note

See :ref:`Defining a Modal Template` for a guide on overriding the default modal template.

HX_REQUESTS_MODAL_TEMPLATE : Default=None

Template to be used for modals. Set to the path of your modal template.
HX_REQUESTS_MODAL_BODY_ID : Default='#hx_modal_body'

A CSS selector for the modal body. This only needs to be set if HX_REQUESTS_MODAL_TEMPLATE is overridden and '.modal-body' is not a valid selector for it.