mirror of
https://github.com/django-components/django-components.git
synced 2025-09-26 15:39:08 +00:00
Adding request
arg to render (#817)
Co-authored-by: Laurence Hole <laurence@safi.co> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
3f2d92f252
commit
dfd4187192
3 changed files with 90 additions and 6 deletions
|
@ -74,6 +74,12 @@ Component.render(
|
|||
- NOTE: In "isolated" mode, context is NOT accessible, and data MUST be passed via
|
||||
component's args and kwargs.
|
||||
|
||||
- _`request`_ - A Django request object. This is used to enable Django template `context_processors` to run,
|
||||
allowing for template tags like `{% csrf_token %}` and variables like `{{ debug }}`.
|
||||
- Similar behavior can be achieved with [provide / inject](#how-to-use-provide--inject).
|
||||
- This is used internally to convert `context` to a RequestContext. It does nothing if `context` is already
|
||||
a `Context` instance.
|
||||
|
||||
### `SlotFunc`
|
||||
|
||||
When rendering components with slots in `render` or `render_to_response`, you can pass either a string or a function.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue