gentle-dream-18175
05/16/2021, 2:09 PMmysterious-toddler-20573
05/16/2021, 2:26 PMblue-manchester-57655
05/16/2021, 4:55 PMblue-manchester-57655
05/16/2021, 4:57 PMgorgeous-ghost-95789
05/16/2021, 4:58 PMgorgeous-ghost-95789
05/16/2021, 4:58 PMgorgeous-ghost-95789
05/16/2021, 4:59 PMblue-manchester-57655
05/16/2021, 5:17 PMsalmon-xylophone-28580
05/16/2021, 6:23 PMblue-manchester-57655
05/16/2021, 6:28 PMsalmon-xylophone-28580
05/16/2021, 6:37 PMmysterious-toddler-20573
05/16/2021, 8:32 PMblue-manchester-57655
05/16/2021, 8:39 PMsparse-musician-64201
05/16/2021, 8:45 PMastonishing-flag-36727
05/16/2021, 11:30 PMgorgeous-ghost-95789
05/17/2021, 12:40 AMbreezy-plastic-1459
05/17/2021, 8:36 AMbreezy-plastic-1459
05/17/2021, 8:36 AMpy
{% load static %}
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>{% block title %}Book store{% endblock title %}</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<!--<link rel='stylesheet' type='text/css' media='screen' href='main.css'>!-->
</head>
<body>
<div class="container">
{% block content %}
<script src="https://unpkg.com/htmx.org@1.3.3"></script>
<script>
document.body.addEventListener('htmx:configRequest', (event) => {
event.detail.headers['X-CSRFToken'] = '{{ csrf_token }}';
})
</script>
{% endblock content %}
</div>
</body>
</html>breezy-plastic-1459
05/17/2021, 8:37 AMpy
{% extends 'base.html' %}
{% block title %}Home{% endblock title %}
{% block content %}
<div hx-target="this" hx-swap="outerHTML">
{% if user.is_authenticated%}
<h1>Welcome {{ user }}</h1>
<a href="{% url "logout" %}"><button type="submit">Log Out</button></a>
{% else %}
<h1>Welcome to my page to view details please register</h1>
<!--<a href="{% url "login" %}">Login</a>!-->
<button hx-get="{% url "login" %}">Login</button>
{% endif %}
</div>
{% endblock content %}gorgeous-airport-54386
05/17/2021, 8:38 AMbreezy-plastic-1459
05/17/2021, 8:39 AMbreezy-plastic-1459
05/17/2021, 8:40 AMmysterious-toddler-20573
05/17/2021, 5:16 PMsalmon-xylophone-28580
05/17/2021, 8:02 PMguettli@yoga15:~/tmp/sub$ npm install htmx --save
added 1 package, and audited 2 packages in 3s
guettli@yoga15:~/tmp/sub$ cat package.json
{
"dependencies": {
"htmx": "^0.0.2"
}
}
Version 0.0.2? Looks a bit strange.gentle-dream-18175
05/17/2021, 8:02 PMsalmon-xylophone-28580
05/17/2021, 8:12 PMsalmon-xylophone-28580
05/17/2021, 8:13 PMgentle-dream-18175
05/17/2021, 8:14 PMmysterious-toddler-20573
05/17/2021, 8:25 PMgentle-dream-18175
05/17/2021, 8:25 PM