Configuration
Settings that need to be set in settings.py
.
HX_REQUESTS_CUSTOM_VIEWS_SETUP
: Default=NoneDict of custom views to a corrensponding get function that mimics the view’s get EXCEPT that it does not return a response (see 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=FalseSet 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=FalseSet this to True to use Django’s
MESSAGE_TAGS
setting for tags.HX_REQUESTS_HX_MESSAGE_TAGS
: No DefaultIf 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 DefaultTemplate to be used for displaying the messages. The context in this template has access to the
messages
.Modal Configuration
Note
See Defining a Modal Template for a guide on overriding the default modal template.
HX_REQUESTS_MODAL_TEMPLATE
: Default=NoneTemplate 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.