generated from bisco/codex-bootstrap
Merge branch 'fix/site-base-url' into develop
This commit is contained in:
11
.env.example
11
.env.example
@@ -12,10 +12,10 @@ FRONTEND_PORT=8080
|
|||||||
|
|
||||||
DJANGO_SECRET_KEY=change-me
|
DJANGO_SECRET_KEY=change-me
|
||||||
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
|
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
|
||||||
DJANGO_CSRF_TRUSTED_ORIGINS=http://localhost:8080
|
DJANGO_CSRF_TRUSTED_ORIGINS=http://localhost
|
||||||
DJANGO_DEBUG=true
|
DJANGO_DEBUG=true
|
||||||
CORS_ALLOWED_ORIGINS=http://localhost:4200,http://localhost:8080,http://localhost
|
CORS_ALLOWED_ORIGINS=http://localhost:4200,http://localhost
|
||||||
SITE_BASE_URL=http://localhost:8080
|
SITE_BASE_URL=http://localhost
|
||||||
TIME_ZONE=Europe/Rome
|
TIME_ZONE=Europe/Rome
|
||||||
EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend
|
EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend
|
||||||
DEFAULT_FROM_EMAIL=no-reply@azionelab.local
|
DEFAULT_FROM_EMAIL=no-reply@azionelab.local
|
||||||
@@ -28,4 +28,7 @@ POSTGRES_PORT=5432
|
|||||||
|
|
||||||
DATABASE_URL=postgres://azionelab:change-me@postgres:5432/azionelab
|
DATABASE_URL=postgres://azionelab:change-me@postgres:5432/azionelab
|
||||||
|
|
||||||
ENVIRONMENT=local
|
ENVIRONMENT=local
|
||||||
|
|
||||||
|
# Local convention: nginx is the public entrypoint on http://localhost.
|
||||||
|
# If you change the published nginx port, update SITE_BASE_URL and trusted origins to match.
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ def csv_env(name, default=""):
|
|||||||
ALLOWED_HOSTS = csv_env("DJANGO_ALLOWED_HOSTS", "localhost,127.0.0.1")
|
ALLOWED_HOSTS = csv_env("DJANGO_ALLOWED_HOSTS", "localhost,127.0.0.1")
|
||||||
CSRF_TRUSTED_ORIGINS = csv_env("DJANGO_CSRF_TRUSTED_ORIGINS")
|
CSRF_TRUSTED_ORIGINS = csv_env("DJANGO_CSRF_TRUSTED_ORIGINS")
|
||||||
CORS_ALLOWED_ORIGINS = csv_env("CORS_ALLOWED_ORIGINS")
|
CORS_ALLOWED_ORIGINS = csv_env("CORS_ALLOWED_ORIGINS")
|
||||||
SITE_BASE_URL = os.environ.get("SITE_BASE_URL", "http://localhost:8080").rstrip("/")
|
SITE_BASE_URL = os.environ.get("SITE_BASE_URL", "http://localhost").rstrip("/")
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
"django.contrib.admin",
|
"django.contrib.admin",
|
||||||
|
|||||||
@@ -103,6 +103,13 @@ Required backend configuration:
|
|||||||
- email host, port, username, password, TLS settings, and sender address;
|
- email host, port, username, password, TLS settings, and sender address;
|
||||||
- public site URL used to build confirmation and QR verification links.
|
- public site URL used to build confirmation and QR verification links.
|
||||||
|
|
||||||
|
Local Docker convention:
|
||||||
|
|
||||||
|
- use nginx as the public entrypoint at `http://localhost`;
|
||||||
|
- set `SITE_BASE_URL=http://localhost`;
|
||||||
|
- keep `DJANGO_CSRF_TRUSTED_ORIGINS` and browser-facing `CORS_ALLOWED_ORIGINS` aligned with that public URL;
|
||||||
|
- if you publish nginx on a different port, update `SITE_BASE_URL` and trusted origins to the same host and port.
|
||||||
|
|
||||||
Required database configuration:
|
Required database configuration:
|
||||||
|
|
||||||
- database name;
|
- database name;
|
||||||
|
|||||||
Reference in New Issue
Block a user