ancient-rose-1570
02/01/2022, 10:07 AMbland-coat-6833
02/01/2022, 10:12 AMhtml
<div hx-get="{% url "deals:deal-create" listing.slug %}"
hx-trigger="load"
id="htmx-ref"
_="on htmx:responseError
set my innerHtml to 'Some error happened 😱'
"
>
{% include "includes/loading.html" %}
</div>
That'll keep all the logic local.white-motorcycle-95262
02/01/2022, 3:58 PMhx-trigger
to CORS_ALLOW_HEADERS
in settings..
Anyone have any experience with this?
EDIT: Looks like you need to add all 8 HTMX request headers to CORS_ALLOW_HEADERS. I used the following in my settings
from corsheaders.defaults import default_headers
CORS_ALLOW_HEADERS = list(default_headers) + [
'hx-boosted',
'hx-current-url',
'hx-history-restore-request',
'hx-prompt',
'hx-request',
'hx-target',
'hx-trigger-name',
'hx-trigger',
]
white-motorcycle-95262
02/01/2022, 3:59 PMquaint-football-59260
02/02/2022, 2:21 PMhundreds-camera-24900
02/02/2022, 3:40 PMhundreds-camera-24900
02/02/2022, 3:40 PMhundreds-camera-24900
02/02/2022, 3:40 PMmysterious-toddler-20573
02/02/2022, 5:08 PMhx-post
on the form in questionacoustic-lawyer-26558
02/05/2022, 3:12 AMhundreds-camera-24900
02/05/2022, 3:24 AMacoustic-lawyer-26558
02/05/2022, 3:28 AMhundreds-camera-24900
02/05/2022, 3:38 AMhundreds-camera-24900
02/05/2022, 3:40 AMacoustic-lawyer-26558
02/05/2022, 3:40 AMacoustic-lawyer-26558
02/05/2022, 3:42 AMhundreds-camera-24900
02/05/2022, 3:42 AMhundreds-camera-24900
02/05/2022, 3:43 AMhundreds-camera-24900
02/05/2022, 3:43 AMmammoth-family-48524
02/05/2022, 8:48 PMmelodic-parrot-20305
02/06/2022, 3:12 PMmelodic-parrot-20305
02/06/2022, 3:12 PMbland-coat-6833
02/06/2022, 3:46 PMhundreds-camera-24900
02/06/2022, 4:17 PMhundreds-camera-24900
02/06/2022, 4:17 PMhundreds-camera-24900
02/06/2022, 4:18 PMhundreds-camera-24900
02/06/2022, 4:18 PMgorgeous-airport-54386
02/06/2022, 4:37 PMhundreds-camera-24900
02/06/2022, 4:39 PM