https://htmx.org logo
```python def hx_render(fullpage, partial): def ...
# 🔥-django-htmx
g
Copy code
python
def hx_render(fullpage, partial):
  def decorator(func):
    @wraps(func)
    def wrapper(request, args, **kwargs):
      context = func(request, *args, **kwargs)
      if request.htmx:
        return render(request, partial, context)
      else:
        return render(request, fullpage, context)

    return wrapper

  return decorator
i haven't touched python in a while and i also don't have django experience, so take this with a grain of salt