Misago
  • Introduction
  • Setup
    • Create server on Digital Ocean
    • Point domain at your server
    • Setup Misago on your Server
    • Upgrading your Misago to latest version
  • Settings
    • Accessing settings
    • Static settings reference
    • Dynamic settings reference
  • Coding style
  • GDPR Compliance Guide
  • Social authentication
  • User rank styles
  • Category styles
  • User authentication
  • Writing new admin actions
  • Permissions framework
  • View decorators
  • Context processors
  • Frontend context
  • Audit trail
  • Forms
  • Cache
  • Sending mails
  • Markup
  • Posting process
  • Profile fields
  • Threads types
  • Extending pages
  • Validating registrations
  • Validators
  • Search filters
  • Template tags
  • Shortcuts
  • View errors
  • Locales
Powered by GitBook
On this page
  • misago.core.context_processors.frontend_context
  • misago.core.context_processors.request_path

Context processors

PreviousView decoratorsNextFrontend context

Last updated 5 years ago

Context Processors are simple python functions that receive HttpRequest object and extend template context with additional values. In addition to , Misago defines its own context processors:

misago.core.context_processors.frontend_context

Exposes frontend_context to templates, allowing you to JSON serialize and pass it to JavaScript frontend:

{% load misago_json %}

<script type="text/javascript">
  const context = {{ frontend_context|as_json }};
  misago.init(context);
</script>

misago.core.context_processors.request_path

This function adds request_path value to template context that you can use together with absoluteurl tag to build absolute links to current page in your templates:

{% load misago_absoluteurl %}
# Will become "http://mysite.com/users/"
{% absoluteurl request_path %}
default context processors defined by Django