Compare commits

...

3 Commits
0.0.5 ... 0.0.8

Author SHA1 Message Date
ducoterra
b309e5fa4a fail safe 2020-04-24 21:14:32 -04:00
ducoterra
a6127703e9 add external ingress 2020-04-24 21:07:34 -04:00
ducoterra
6be7034f9b disable button while submitting 2020-04-24 21:05:19 -04:00
4 changed files with 42 additions and 2 deletions

View File

@@ -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'
# 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"]

View File

@@ -15,4 +15,40 @@ spec:
paths:
- backend:
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

View File

@@ -5,6 +5,7 @@ import sys
def main():
os.environ.setdefault('DEBUG', 'True')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
try:
from django.core.management import execute_from_command_line

View File

@@ -19,6 +19,7 @@ var button = document.getElementById("BUTTON");
var count = document.getElementById("COUNT");
button.addEventListener("click", event => {
button.disabled = true;
fetch('/button', {
method: 'POST',
headers: {
@@ -31,6 +32,8 @@ button.addEventListener("click", event => {
})
.then((data) => {
count.innerText = data.pressed;
}).finally(() => {
button.disabled = false;
});
});