From c5f882c32c829c0154e27499c669d2214d46ee5b Mon Sep 17 00:00:00 2001 From: csd4ni3l Date: Tue, 12 Aug 2025 15:51:15 +0200 Subject: [PATCH] fix register not working due to wrong url_for parameter and update README.md for a better solution to easyocr --- README.md | 15 ++++----------- templates/register.jinja2 | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 3a29605..4f3c110 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,10 @@ A captcha/login page which only allows you to register if you post an image of y To install, you have to install everything in requirements.txt or do uv sync, but you also have to install easyocr. On my machine, i did this because i wanted to install the CPU version of torch or otherwise it would install NVIDIA bloat. -If you want to do the same, do: +If you want to do the same, add `extra-index-url`: ```bash -uv pip install torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu -uv pip install easyocr +uv pip install easyocr --extra-index-url https://download.pytorch.org/whl/cpu ``` -or the same without uv if you use pip. - -If you want to install it with GPU acceleration for the OCR part, do: - -```bash -uv pip install easyocr -``` -or the same without uv if you use pip. \ No newline at end of file +Dont add the flag if you have a dedicated GPU on the computer where you host the project. +Run the command without uv if you use pip. \ No newline at end of file diff --git a/templates/register.jinja2 b/templates/register.jinja2 index 1e8fe9b..2cd524b 100644 --- a/templates/register.jinja2 +++ b/templates/register.jinja2 @@ -126,7 +126,7 @@ submit_button.addEventListener("click", submit) function get_challenge() { username_input = document.getElementById("usernameinput") - fetch('{{ url_for("generate_challenge") }}', { + fetch('{{ url_for("generate_challenge_route") }}', { method: "POST", body: JSON.stringify({username: username_input.value}), headers: {