Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom context processor not rendering on htmx responses #289

Closed
lolrenx opened this issue Nov 15, 2022 · 1 comment
Closed

custom context processor not rendering on htmx responses #289

lolrenx opened this issue Nov 15, 2022 · 1 comment

Comments

@lolrenx
Copy link

lolrenx commented Nov 15, 2022

Python Version

3.10

Django Version

4.1

Package Version

1.13.0

Description

on the context processor:

def custom_context(request):
    return {
        "OUTERHTML_W_DURATION": f"outerHTML swap:{settings.DOM_SWAP_DURATION}",
    }

it is properly registered in the settings, full page responses compile the value properly

on the template:

hx-swap="{{OUTERHTML_W_DURATION}}"

on the page:
Screenshot 2022-11-15 at 17 48 57

@adamchainz
Copy link
Owner

django-htmx doesn't affect the templating lagnuage. It’s unlikely that anything to do with this library is affecting your custom processor. Try loading the URL without htmx, or using the context processor on another page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants