Create Makefile and remove more files
This commit is contained in:
parent
229d293f1e
commit
71aacef372
|
@ -0,0 +1,11 @@
|
||||||
|
run:
|
||||||
|
docker-compose -f docker/docker-compose.prod.yml --env-file=stack.env up -d
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker-compose -f docker/docker-compose.prod.yml --env-file=stack.env build
|
||||||
|
|
||||||
|
stop:
|
||||||
|
docker-compose -f docker/docker-compose.prod.yml --env-file=stack.env down
|
||||||
|
|
||||||
|
log:
|
||||||
|
docker-compose -f docker/docker-compose.prod.yml --env-file=stack.env logs -f
|
|
@ -1,22 +1,22 @@
|
||||||
{
|
{
|
||||||
const data = document.currentScript.dataset;
|
const data = document.currentScript.dataset;
|
||||||
const isDebug = data.debug === "True";
|
const isDebug = data.debug === "True";
|
||||||
|
|
||||||
if (isDebug) {
|
if (isDebug) {
|
||||||
document.addEventListener("htmx:beforeOnLoad", function (event) {
|
document.addEventListener("htmx:beforeOnLoad", function (event) {
|
||||||
const xhr = event.detail.xhr;
|
const xhr = event.detail.xhr;
|
||||||
if (xhr.status == 500 || xhr.status == 404) {
|
if (xhr.status == 500 || xhr.status == 404) {
|
||||||
// Tell htmx to stop processing this response
|
// Tell htmx to stop processing this response
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
document.children[0].innerHTML = xhr.response;
|
document.children[0].innerHTML = xhr.response;
|
||||||
|
|
||||||
// Run Django’s inline script
|
// Run Django’s inline script
|
||||||
// (1, eval) wtf - see https://stackoverflow.com/questions/9107240/1-evalthis-vs-evalthis-in-javascript
|
// (1, eval) wtf - see https://stackoverflow.com/questions/9107240/1-evalthis-vs-evalthis-in-javascript
|
||||||
(1, eval)(document.scripts[0].innerText);
|
(1, eval)(document.scripts[0].innerText);
|
||||||
// Need to directly call Django’s onload function since browser won’t
|
// Need to directly call Django’s onload function since browser won’t
|
||||||
window.onload();
|
window.onload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Home(View):
|
||||||
template_name = "index.html"
|
template_name = "index.html"
|
||||||
|
|
||||||
async def get(self, request):
|
async def get(self, request):
|
||||||
# await sleep(1)
|
await sleep(1)
|
||||||
return render(request, self.template_name)
|
return render(request, self.template_name)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
# syntax=docker/dockerfile:1
|
|
||||||
FROM python:3
|
|
||||||
|
|
||||||
RUN useradd -d /code xf
|
|
||||||
RUN mkdir /code
|
|
||||||
RUN chown xf:xf /code
|
|
||||||
|
|
||||||
RUN mkdir /venv
|
|
||||||
RUN chown xf:xf /venv
|
|
||||||
|
|
||||||
USER xf
|
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
|
||||||
ENV PYTHONUNBUFFERED=1
|
|
||||||
WORKDIR /code
|
|
||||||
COPY requirements.dev.txt /code/
|
|
||||||
RUN python -m venv /venv
|
|
||||||
RUN . /venv/bin/activate && pip install -r requirements.dev.txt
|
|
||||||
CMD . /venv/bin/activate && exec python manage.py runserver 0.0.0.0:8000
|
|
|
@ -1,12 +0,0 @@
|
||||||
wheel
|
|
||||||
django
|
|
||||||
pre-commit
|
|
||||||
django-crispy-forms
|
|
||||||
crispy-bulma
|
|
||||||
stripe
|
|
||||||
django-rest-framework
|
|
||||||
django-htmx
|
|
||||||
cryptography
|
|
||||||
django-debug-toolbar
|
|
||||||
django-debug-toolbar-template-profiler
|
|
||||||
orjson
|
|
Loading…
Reference in New Issue