Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b309e5fa4a | ||
|
|
a6127703e9 | ||
|
|
6be7034f9b | ||
|
|
1adaf20f61 |
@@ -23,7 +23,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|||||||
SECRET_KEY = 'b8fi9=f-qj=@-#1iru34-f@a6pzfysgrf(1n_&d=ur%!1w$q*w'
|
SECRET_KEY = 'b8fi9=f-qj=@-#1iru34-f@a6pzfysgrf(1n_&d=ur%!1w$q*w'
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = True if os.getenv("DEBUG") == "True" else False
|
||||||
|
|
||||||
ALLOWED_HOSTS = ["localhost", "test.ducoterra.net"]
|
ALLOWED_HOSTS = ["localhost", "test.ducoterra.net"]
|
||||||
|
|
||||||
|
|||||||
@@ -15,4 +15,40 @@ spec:
|
|||||||
paths:
|
paths:
|
||||||
- backend:
|
- backend:
|
||||||
serviceName: test
|
serviceName: test
|
||||||
servicePort: 8000
|
servicePort: 8000
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: traefik.containo.us/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: test-external-tls
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- websecure
|
||||||
|
tls:
|
||||||
|
secretName: letsencrypt
|
||||||
|
routes:
|
||||||
|
- match: Host(`test.ducoterra.net`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: test
|
||||||
|
port: 80
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: traefik.containo.us/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: test-external-web
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- web
|
||||||
|
routes:
|
||||||
|
- match: Host(`test.ducoterra.net`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: test
|
||||||
|
port: 80
|
||||||
|
middlewares:
|
||||||
|
- name: httpsredirect
|
||||||
@@ -5,6 +5,7 @@ import sys
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
os.environ.setdefault('DEBUG', 'True')
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
|
||||||
try:
|
try:
|
||||||
from django.core.management import execute_from_command_line
|
from django.core.management import execute_from_command_line
|
||||||
|
|||||||
0
ui/static/ui/button.css
Normal file
0
ui/static/ui/button.css
Normal file
@@ -19,6 +19,7 @@ var button = document.getElementById("BUTTON");
|
|||||||
var count = document.getElementById("COUNT");
|
var count = document.getElementById("COUNT");
|
||||||
|
|
||||||
button.addEventListener("click", event => {
|
button.addEventListener("click", event => {
|
||||||
|
button.disabled = true;
|
||||||
fetch('/button', {
|
fetch('/button', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -31,6 +32,8 @@ button.addEventListener("click", event => {
|
|||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
count.innerText = data.pressed;
|
count.innerText = data.pressed;
|
||||||
|
}).finally(() => {
|
||||||
|
button.disabled = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
24
ui/templates/ui/base.html
Normal file
24
ui/templates/ui/base.html
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{% load static %}
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>The Button</title>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.2/css/bulma.min.css">
|
||||||
|
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
|
||||||
|
{% block css %}
|
||||||
|
{% endblock %}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block js %}
|
||||||
|
{% endblock %}
|
||||||
|
</body>
|
||||||
@@ -1,33 +1,29 @@
|
|||||||
|
{% extends 'ui/base.html' %}
|
||||||
|
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
{% block css %}
|
||||||
<html>
|
<link rel="stylesheet" href="{% static 'ui/button.css' %}">
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
<head>
|
{% block js %}
|
||||||
<meta charset="utf-8">
|
<script src="{% static 'ui/button.js' %}"></script>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
{% endblock %}
|
||||||
<title>Hello Bulma!</title>
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.2/css/bulma.min.css">
|
|
||||||
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
{% csrf_token %}
|
{% block body %}
|
||||||
<section class="section">
|
<section class="section">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div>
|
<div>
|
||||||
<h1 class="title">
|
<h1 class="title">
|
||||||
The Button
|
The Button
|
||||||
</h1>
|
</h1>
|
||||||
<button class="button" id="BUTTON">Press</button>
|
<button class="button is-primary" id="BUTTON">Press</button>
|
||||||
</div>
|
|
||||||
<div><br></div>
|
|
||||||
<div>
|
|
||||||
<h1 class="title" id="COUNT">{{ pressed }}</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
<div><br></div>
|
||||||
<script src="{% static 'ui/button.js' %}"></script>
|
<div>
|
||||||
</body>
|
<h1 class="title" id="COUNT">{{ pressed }}</h1>
|
||||||
|
</div>
|
||||||
</html>
|
</div>
|
||||||
|
</section>
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user