Skip to content

Commit a5eb547

Browse files
Aggiunta variabile d'ambiente per la GUI (#391)
* Added CSRF_TRUSTED_ORIGINS * Updated README GUI
1 parent 6fbd5b5 commit a5eb547

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

GUI/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
Web GUI per ricerca e download.
1+
# Web GUI per ricerca e download
22

3-
Comandi rapidi:
3+
## Comandi rapidi:
44
- Installazione deps: `pip install -r .\GUI\requirements.txt`
55
- Esecuzione migrazioni: `python GUI/manage.py migrate`
6-
- Avvio dev: `python GUI/manage.py runserver 0.0.0.0:8000`
6+
- Avvio dev: `python GUI/manage.py runserver 0.0.0.0:8000`
7+
8+
## Problemi di CSRF
9+
- In caso di problemi quando si effettua una ricerca al di fuori della propria rete (magari sotto un reverse proxy) impostare la variabile d'ambiente `CSRF_TRUSTED_ORIGINS`
10+
> Esempio: `CSRF_TRUSTED_ORIGINS="http://127.0.0.1:8000 https://altrodominio.it"`

GUI/webgui/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,5 @@
7070
STATICFILES_DIRS = [BASE_DIR / "assets"] if (BASE_DIR / "assets").exists() else []
7171

7272
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
73+
74+
CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS", "").split()

0 commit comments

Comments
 (0)