# Context processors

Context Processors are simple python functions that receive HttpRequest object and extend template context with additional values. In addition to [default context processors defined by Django](https://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext), 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 %}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://misago.gitbook.io/docs/contextprocessors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
