diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f965aed --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +node_modules +Dockerfile* +docker-compose* +.dockerignore +.git +.gitignore +README.md +LICENSE +.vscode +Makefile +helm-charts +.env +.editorconfig +.idea +coverage* diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..3d6990e --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,52 @@ +name: Build image +on: + push: + branches: + - main + - build + tags: + - v* + +jobs: + build: + container: + image: docker:dind + volumes: + - /data/.cache/act:/data/.cache/act + - /var/lib/docker/image:/var/lib/docker/image + - /var/lib/docker/overlay2:/var/lib/docker/overlay2 + steps: + - name: Starting docker daemon + run: docker-init -- dockerd --host=unix:///var/run/docker.sock & + - name: Installing necessary packages + run: apk add nodejs git curl bash + - name: Checkout + uses: actions/checkout@v3 + - name: Docker meta + id: meta + uses: https://github.com/docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + git.fai.st/fedi-image-bot/bot-api + # generate Docker tags based on the following events/attributes + tags: | + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + type=ref,event=branch + type=semver,pattern={{raw}} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to fai.st docker registry + uses: docker/login-action@v2 + with: + registry: git.fai.st + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASS }} + - name: Build and push + uses: docker/build-push-action@v4 + with: + platforms: linux/amd64,linux/arm64 + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore index 1edcd94..a1d09b8 100755 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,5 @@ -videos/ -ftp/ - -### Django ### -*.log -*.pot -*.pyc -__pycache__/ -local_settings.py -db.sqlite3 -media -migrations/ +### TS +node_modules/ ### Testing ### .coverage diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e4c186e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM oven/bun:1 AS base + +WORKDIR /usr/src/app + +FROM base AS install +RUN mkdir -p /temp/prod +COPY package.json bun.lockb /temp/prod/ +RUN cd /temp/prod && bun install --frozen-lockfile --production + +FROM base AS release +COPY --from=install /temp/prod/node_modules node_modules +COPY . . + +# run the app +USER bun +EXPOSE 8080/tcp +ENTRYPOINT [ "bun", "run", "src/index.ts" ] diff --git a/README.md b/README.md new file mode 100644 index 0000000..9dcd8f0 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# website + +To install dependencies: + +```bash +bun install +``` + +To run: + +```bash +bun run index.ts +``` + +This project was created using `bun init` in bun v1.0.20. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..8f030ec Binary files /dev/null and b/bun.lockb differ diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 8937f23..0000000 --- a/deploy.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -rsync -rv webpage django:/home/django/personalWebpage/ -ssh django "bash -s" < ({ + name: image, + url: remove_extension(image), + folder: type, + })); + return image_list; +} + +class App { + index(_req: Request, res: Response) { + res.render("index.njk", { + page: "index", + title: "THE INDEX", + image, + ad + }); + } +} + +export default new App(); diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..a15d33d --- /dev/null +++ b/src/index.ts @@ -0,0 +1,16 @@ +import express from "express"; +import nunjucks from "nunjucks"; +import app from "src/app"; + +const site = express(); + +nunjucks.configure("templates", { + autoescape: true, + express: site, +}); + +site.use(express.static(".")); + +site.get("/", app.index); + +site.listen(8080, () => console.log("app listening on 8080")); diff --git a/webpage/static/ads/ads b/static/ads/ads similarity index 100% rename from webpage/static/ads/ads rename to static/ads/ads diff --git a/webpage/static/ads/hor/buynow.gif b/static/ads/hor/buynow.gif similarity index 100% rename from webpage/static/ads/hor/buynow.gif rename to static/ads/hor/buynow.gif diff --git a/webpage/static/ads/hor/catgirl.png b/static/ads/hor/catgirl.png similarity index 100% rename from webpage/static/ads/hor/catgirl.png rename to static/ads/hor/catgirl.png diff --git a/webpage/static/ads/hor/gay.jpg b/static/ads/hor/gay.jpg similarity index 100% rename from webpage/static/ads/hor/gay.jpg rename to static/ads/hor/gay.jpg diff --git a/webpage/static/ads/hor/ie.png b/static/ads/hor/ie.png similarity index 100% rename from webpage/static/ads/hor/ie.png rename to static/ads/hor/ie.png diff --git a/webpage/static/ads/hor/lies.jpg b/static/ads/hor/lies.jpg similarity index 100% rename from webpage/static/ads/hor/lies.jpg rename to static/ads/hor/lies.jpg diff --git a/webpage/static/ads/hor/orb.gif b/static/ads/hor/orb.gif similarity index 100% rename from webpage/static/ads/hor/orb.gif rename to static/ads/hor/orb.gif diff --git a/webpage/static/ads/hor/ram.png b/static/ads/hor/ram.png similarity index 100% rename from webpage/static/ads/hor/ram.png rename to static/ads/hor/ram.png diff --git a/webpage/static/background/about.png b/static/background/about.png similarity index 100% rename from webpage/static/background/about.png rename to static/background/about.png diff --git a/webpage/static/background/index.png b/static/background/index.png similarity index 100% rename from webpage/static/background/index.png rename to static/background/index.png diff --git a/webpage/static/icon.png b/static/icon.png similarity index 100% rename from webpage/static/icon.png rename to static/icon.png diff --git a/webpage/static/icons/88x31/dendy.cat.png b/static/icons/8831/dendy.cat.png similarity index 100% rename from webpage/static/icons/88x31/dendy.cat.png rename to static/icons/8831/dendy.cat.png diff --git a/webpage/static/icons/88x31/lavenderfield.xyz.gif b/static/icons/8831/lavenderfield.xyz.gif similarity index 100% rename from webpage/static/icons/88x31/lavenderfield.xyz.gif rename to static/icons/8831/lavenderfield.xyz.gif diff --git a/webpage/static/icons/88x31/moth.monster.png b/static/icons/8831/moth.monster.png similarity index 100% rename from webpage/static/icons/88x31/moth.monster.png rename to static/icons/8831/moth.monster.png diff --git a/webpage/static/icons/88x31/remiiiiii.online.png b/static/icons/8831/remiiiiii.online.png old mode 100755 new mode 100644 similarity index 100% rename from webpage/static/icons/88x31/remiiiiii.online.png rename to static/icons/8831/remiiiiii.online.png diff --git a/webpage/static/icons/88x31/sugui.fai.st.gif b/static/icons/8831/sugui.fai.st.gif similarity index 100% rename from webpage/static/icons/88x31/sugui.fai.st.gif rename to static/icons/8831/sugui.fai.st.gif diff --git a/webpage/static/icons/banner/discord.gif b/static/icons/banner/discord.gif similarity index 100% rename from webpage/static/icons/banner/discord.gif rename to static/icons/banner/discord.gif diff --git a/webpage/static/icons/banner/gay.png b/static/icons/banner/gay.png similarity index 100% rename from webpage/static/icons/banner/gay.png rename to static/icons/banner/gay.png diff --git a/webpage/static/icons/banner/html.gif b/static/icons/banner/html.gif similarity index 100% rename from webpage/static/icons/banner/html.gif rename to static/icons/banner/html.gif diff --git a/webpage/static/icons/banner/ie.gif b/static/icons/banner/ie.gif similarity index 100% rename from webpage/static/icons/banner/ie.gif rename to static/icons/banner/ie.gif diff --git a/webpage/static/icons/banner/linux.png b/static/icons/banner/linux.png similarity index 100% rename from webpage/static/icons/banner/linux.png rename to static/icons/banner/linux.png diff --git a/webpage/static/icons/banner/nft.gif b/static/icons/banner/nft.gif similarity index 100% rename from webpage/static/icons/banner/nft.gif rename to static/icons/banner/nft.gif diff --git a/webpage/static/icons/banner/showbroslove.jpg b/static/icons/banner/showbroslove.jpg similarity index 100% rename from webpage/static/icons/banner/showbroslove.jpg rename to static/icons/banner/showbroslove.jpg diff --git a/webpage/static/icons/banner/thiswebsiteisgay.gif b/static/icons/banner/thiswebsiteisgay.gif similarity index 100% rename from webpage/static/icons/banner/thiswebsiteisgay.gif rename to static/icons/banner/thiswebsiteisgay.gif diff --git a/webpage/static/icons/banner/transgender.png b/static/icons/banner/transgender.png similarity index 100% rename from webpage/static/icons/banner/transgender.png rename to static/icons/banner/transgender.png diff --git a/webpage/static/icons/banner/www.gif b/static/icons/banner/www.gif similarity index 100% rename from webpage/static/icons/banner/www.gif rename to static/icons/banner/www.gif diff --git a/webpage/static/icons/banner/xenia.gif b/static/icons/banner/xenia.gif similarity index 100% rename from webpage/static/icons/banner/xenia.gif rename to static/icons/banner/xenia.gif diff --git a/webpage/static/icons/bizcochito.gif b/static/icons/bizcochito.gif similarity index 100% rename from webpage/static/icons/bizcochito.gif rename to static/icons/bizcochito.gif diff --git a/webpage/static/icons/coconut.png b/static/icons/coconut.png similarity index 100% rename from webpage/static/icons/coconut.png rename to static/icons/coconut.png diff --git a/webpage/static/icons/gif/I‘m-not-a-robot.gif b/static/icons/gif/I‘m-not-a-robot.gif similarity index 100% rename from webpage/static/icons/gif/I‘m-not-a-robot.gif rename to static/icons/gif/I‘m-not-a-robot.gif diff --git a/webpage/static/icons/gif/banana.gif b/static/icons/gif/banana.gif similarity index 100% rename from webpage/static/icons/gif/banana.gif rename to static/icons/gif/banana.gif diff --git a/webpage/static/icons/gif/blobcat.gif b/static/icons/gif/blobcat.gif similarity index 100% rename from webpage/static/icons/gif/blobcat.gif rename to static/icons/gif/blobcat.gif diff --git a/webpage/static/icons/gif/cassette.gif b/static/icons/gif/cassette.gif similarity index 100% rename from webpage/static/icons/gif/cassette.gif rename to static/icons/gif/cassette.gif diff --git a/webpage/static/icons/gif/deviantart_321712895_Catgirls Stamp-web.jpg b/static/icons/gif/deviantart_321712895_Catgirls Stamp-web.jpg similarity index 100% rename from webpage/static/icons/gif/deviantart_321712895_Catgirls Stamp-web.jpg rename to static/icons/gif/deviantart_321712895_Catgirls Stamp-web.jpg diff --git a/webpage/static/icons/gif/drancingmoe.gif b/static/icons/gif/drancingmoe.gif similarity index 100% rename from webpage/static/icons/gif/drancingmoe.gif rename to static/icons/gif/drancingmoe.gif diff --git a/webpage/static/icons/gif/enby.gif b/static/icons/gif/enby.gif similarity index 100% rename from webpage/static/icons/gif/enby.gif rename to static/icons/gif/enby.gif diff --git a/webpage/static/icons/gif/hatkid.gif b/static/icons/gif/hatkid.gif similarity index 100% rename from webpage/static/icons/gif/hatkid.gif rename to static/icons/gif/hatkid.gif diff --git a/webpage/static/icons/gif/milk.png b/static/icons/gif/milk.png similarity index 100% rename from webpage/static/icons/gif/milk.png rename to static/icons/gif/milk.png diff --git a/webpage/static/icons/gif/parrot.gif b/static/icons/gif/parrot.gif similarity index 100% rename from webpage/static/icons/gif/parrot.gif rename to static/icons/gif/parrot.gif diff --git a/webpage/static/icons/gif/pumpum.gif b/static/icons/gif/pumpum.gif similarity index 100% rename from webpage/static/icons/gif/pumpum.gif rename to static/icons/gif/pumpum.gif diff --git a/webpage/static/icons/gif/yippee-flip.gif b/static/icons/gif/yippee-flip.gif similarity index 100% rename from webpage/static/icons/gif/yippee-flip.gif rename to static/icons/gif/yippee-flip.gif diff --git a/webpage/static/style.css b/static/style.css similarity index 100% rename from webpage/static/style.css rename to static/style.css diff --git a/templates/ad.njk b/templates/ad.njk new file mode 100644 index 0000000..d077e7d --- /dev/null +++ b/templates/ad.njk @@ -0,0 +1,7 @@ +{% macro adimage(ad) %} +
+ + ad + +
+{% endmacro %} diff --git a/templates/base.njk b/templates/base.njk new file mode 100644 index 0000000..a67f0c6 --- /dev/null +++ b/templates/base.njk @@ -0,0 +1,12 @@ + + + + + + {{ title }} + + + {% block body %} + {% endblock body %} + + diff --git a/templates/imagelist.njk b/templates/imagelist.njk new file mode 100644 index 0000000..ae77e15 --- /dev/null +++ b/templates/imagelist.njk @@ -0,0 +1,12 @@ +{% macro images_list(image_list) %} +
+ {% for image in image_list %} + + {{ image.url }} + + {% endfor %} +
+{% endmacro %} diff --git a/templates/index.njk b/templates/index.njk new file mode 100755 index 0000000..1e287a9 --- /dev/null +++ b/templates/index.njk @@ -0,0 +1,47 @@ +{% extends "base.njk" %} +{% block body %} +
+

+ I'm bizcochito, hey! +

+

+ Banners +

+ {% from "imagelist.njk" import images_list as il1 %} + {{ il1(image("banner") ) }} +

+ Funni gifs +

+ {% from "imagelist.njk" import images_list as il2 %} + {{ il2(image("gif") ) }} +

+ Frens +

+ {% from "imagelist.njk" import images_list as il3 %} + {{ il3(image("8831") ) }} +

+ Another banner that is unused +

+
+ + cronut.cafe/~bizcochito + +
+

+ BANNER +

+
+ + yari.fai.st + +
+
+ {% from "ad.njk" import adimage %} + {{ adimage(ad() ) }} +{% endblock body %} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..9621e5e --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "lib": ["ESNext"], + "target": "ESNext", + "module": "ESNext", + "moduleDetection": "force", + "jsx": "react-jsx", + "allowJs": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "noEmit": true, + + /* Linting */ + "skipLibCheck": true, + "strict": true, + "noFallthroughCasesInSwitch": true, + "forceConsistentCasingInFileNames": true, + + "baseUrl": "./" + } +} diff --git a/webpage/__init__.py b/webpage/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/webpage/admin.py b/webpage/admin.py deleted file mode 100644 index 6bbd798..0000000 --- a/webpage/admin.py +++ /dev/null @@ -1,7 +0,0 @@ -from django.contrib import admin - -from .models import Booksigner - -# Register your models here. - -admin.site.register(Booksigner) \ No newline at end of file diff --git a/webpage/apps.py b/webpage/apps.py deleted file mode 100644 index 36259cb..0000000 --- a/webpage/apps.py +++ /dev/null @@ -1,4 +0,0 @@ -from django.apps import AppConfig - -class ConfigWebpage(AppConfig): - name = 'webpage' diff --git a/webpage/forms.py b/webpage/forms.py deleted file mode 100644 index d3ea14e..0000000 --- a/webpage/forms.py +++ /dev/null @@ -1,16 +0,0 @@ -from re import Pattern -from django import forms -from django.core.exceptions import ValidationError -from django.utils.translation import gettext_lazy as txt - -class SignbookForm(forms.Form): - name = forms.CharField(label="Name") - website = forms.CharField(label="Website", required=False) - email = forms.EmailField(label="Email", required=False) - comment = forms.CharField(label="Comment", required=False) - capcha = forms.CharField(label="Tell me that you love 'me'") - - def validate_capcha(self): - if self.cleaned_data["capcha"].lower() != "i love me": - raise ValidationError(txt('Invalid captcha'), code="invalid") - return self \ No newline at end of file diff --git a/webpage/models.py b/webpage/models.py deleted file mode 100644 index 23eba28..0000000 --- a/webpage/models.py +++ /dev/null @@ -1,8 +0,0 @@ -from django.db import models -# Create your models here. - -class Booksigner(models.Model): - name = models.CharField(max_length=50) - website = models.CharField(blank=True, max_length=200) - email = models.EmailField(blank=True, ) - comment = models.CharField(blank=True, max_length=500) \ No newline at end of file diff --git a/webpage/static/icons/fediring.png b/webpage/static/icons/fediring.png deleted file mode 100755 index 72cca9e..0000000 Binary files a/webpage/static/icons/fediring.png and /dev/null differ diff --git a/webpage/static/icons/last.png b/webpage/static/icons/last.png deleted file mode 100755 index 590c3da..0000000 Binary files a/webpage/static/icons/last.png and /dev/null differ diff --git a/webpage/static/icons/next.png b/webpage/static/icons/next.png deleted file mode 100755 index d61590b..0000000 Binary files a/webpage/static/icons/next.png and /dev/null differ diff --git a/webpage/templates/about.html b/webpage/templates/about.html deleted file mode 100755 index 6b4b78d..0000000 --- a/webpage/templates/about.html +++ /dev/null @@ -1,114 +0,0 @@ - - - {% include "head.html" %} - -
-

- So hey, you want to know more about me. Here u have! -

-
-

- A thing i need to say is that this page one day could be deprecated bc - of me just not remembering to change anything. -

-

- Index -

- -

- How to adress me -

-

- So first of all if you are not gonna adress me directly or you don't - know me yet just call me Bizcochito! -
-

-

- You can call me: -

-
    -
  • - Yari -
  • -
  • - Alicia -
  • -
  • - Maria -
  • -
  • - Bizcochito -
  • -
-

- Also if you are gonna "pronoun" me, please think before if u can just - use the name "Yari" that is literaly like "They" long. -

-

- If you insist in using pronouns you can use this - (in order of preference) : -

-
    -
  • - My names -
  • -
  • - Literally anything but he -
  • -
-

- Who i am -

-

- Existential question i have yet not answered -

-

- What i am -

-

- A silly colection of bytes -

-

- Where to contact me -

-
- {# djlint: ignore D018 #} - XMPP - - - Personal Mail - - - Pleroma - -
-
- IDK return back -
- - diff --git a/webpage/templates/fediring.html b/webpage/templates/fediring.html deleted file mode 100644 index f4faac1..0000000 --- a/webpage/templates/fediring.html +++ /dev/null @@ -1,26 +0,0 @@ -{% load static %} -
-
- - LAST - - - FEDIRING - - - NEXT - -
-

- Fediring links -

-
diff --git a/webpage/templates/head.html b/webpage/templates/head.html deleted file mode 100644 index 93a44ee..0000000 --- a/webpage/templates/head.html +++ /dev/null @@ -1,6 +0,0 @@ -{% load static %} - - - - {{ title }} - diff --git a/webpage/templates/index.html b/webpage/templates/index.html deleted file mode 100755 index 20abbcf..0000000 --- a/webpage/templates/index.html +++ /dev/null @@ -1,86 +0,0 @@ -{% load static %} - - - {% include "head.html" %} - - {% include "fediring.html" %} -
-
-

- I'm bizcochito, hey! -

-

- -Pages: -

- -

- -Banners -

-
- {% for gif in banger_list %} - {{ gif.url }} - {% endfor %} -
-

- -Funni gifs -

-
- {% for gif in gif_list %} - {{ gif.url }} - {% endfor %} -
-

- -Frens: -

-
- {% for banner in banner_list %} - - {{ banner.url }} - - {% endfor %} -
-

- -Another banner that is unused: -

-
- - cronut.cafe/~bizcochito - -
-

- -NEW BANNER: -

-
- - yari.fai.st - -
-
-
- - ad - -
-
- - - diff --git a/webpage/templates/signbook.html b/webpage/templates/signbook.html deleted file mode 100755 index 6dd9d7d..0000000 --- a/webpage/templates/signbook.html +++ /dev/null @@ -1,58 +0,0 @@ - - - {% include "head.html" %} - -
-

- Cool signers: -

- {% if signer_list %} -

-

-

- {% else %} -

- No one signed here :( -

- {% endif %} -
-
-

- Be part of this cuties! -

-

-

-

- {% csrf_token %} - {% if error_message %} -

- {{ error_message }} -

- {% endif %} - - {{ form.as_table }} -
- -
-

-

-
- - diff --git a/webpage/tests.py b/webpage/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/webpage/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/webpage/urls.py b/webpage/urls.py deleted file mode 100644 index 813079b..0000000 --- a/webpage/urls.py +++ /dev/null @@ -1,10 +0,0 @@ -from django.urls import path - -from . import views - -app_name = "webpage" -urlpatterns = [ - path("signbook/", views.signbook, name="signbook"), - path("about/", views.about, name="about"), - path("", views.index, name="index"), -] \ No newline at end of file diff --git a/webpage/views.py b/webpage/views.py deleted file mode 100755 index b845611..0000000 --- a/webpage/views.py +++ /dev/null @@ -1,102 +0,0 @@ -import os -import random - -from django.forms import ValidationError -from django.http import HttpResponseNotFound -from django.shortcuts import render - -from .models import Booksigner -from .forms import SignbookForm - -def image_dict_from_name_list(name_list: list[str]): - dict_list = [] - for name in name_list: - url = name.split(".") - url.pop() - url = ".".join(url) - dict_list.append({ - "name": name, - "url": url - } - ) - return dict_list - -def index(request): - # Get random ad from ad dir - ad_list = os.listdir(os.path.join(os.path.dirname(os.path.dirname(__file__)), "webpage", "static/ads/hor/")) - ad = random.choice(ad_list) - # Get list of 81x33 icons - banner_list = image_dict_from_name_list(os.listdir(os.path.join(os.path.dirname(os.path.dirname(__file__)), "webpage", "static/icons/88x31/"))) - # Get list of funni gifs - gif_list = image_dict_from_name_list(os.listdir(os.path.join(os.path.dirname(os.path.dirname(__file__)), "webpage", "static/icons/gif/"))) - # Get list of banners - banger_list = image_dict_from_name_list(os.listdir(os.path.join(os.path.dirname(os.path.dirname(__file__)), "webpage", "static/icons/banner/"))) - if not ad or not banner_list or not gif_list: - return HttpResponseNotFound() - else: - context = { - "title": "THE INDEX", - "ad": ad, - "banner_list": banner_list, - "gif_list": gif_list, - "banger_list": banger_list, - } - return render(request,"index.html", context) - -def about(request): - return render(request, "about.html", {"title": "About Me"}) - -def signbook(request): - signer_list = Booksigner.objects.all() - if request.method == 'POST': - form = SignbookForm(request.POST) - try: - if form.is_valid() and form.validate_capcha(): - newsigner = {} - newsigner["name"] = form.cleaned_data['name'] - newsigner["website"] = form.cleaned_data['website'] - newsigner["email"] = form.cleaned_data['email'] - newsigner["comment"] = form.cleaned_data['comment'] - - signer_list = Booksigner.objects.all() - if newsigner: - Booksigner.objects.create( - name=newsigner["name"], - email=newsigner["email"], - website=newsigner["website"], - comment=newsigner["comment"], - ) - context = { - "title": "THE GUESTBOOK", - "signer_list": signer_list - } - return render(request, "signbook.html", context) - context = { - "title": "THE GUESTBOOK", - "signer_list": signer_list, - "error_message": "You didn't input a required input.", - } - return render( - request, - "signbook.html", - context - ) - except ValidationError as e: - print("Error: ", e) - context = { - "title": "THE GUESTBOOK", - "signer_list": signer_list, - "error_message": "Invalid captcha.", - } - return render( - request, - "signbook.html", - context - ) - else: - context = { - "title": "THE GUESTBOOK", - "signer_list": signer_list, - "form": SignbookForm() - } - return render(request, "signbook.html", context)