From 4ba453b7a6246291e7c0fe808e75f6faa5f880e6 Mon Sep 17 00:00:00 2001 From: Matteo Rosati Date: Tue, 10 Feb 2026 23:43:04 +0100 Subject: [PATCH] add static files, whitenoise and uvicorn --- .gitignore | 2 + dronewars/settings.py | 4 ++ frontend/static/frontend/css/home.css | 31 +++++++++++++++ frontend/templates/frontend/base.html | 2 + frontend/templates/frontend/home.html | 3 +- pyproject.toml | 2 + requirements.txt | 15 +++++++ uv.lock | 56 +++++++++++++++++++++++++++ 8 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 frontend/static/frontend/css/home.css create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore index 505a3b1..0820614 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ wheels/ # Virtual environments .venv + +staticfiles/ diff --git a/dronewars/settings.py b/dronewars/settings.py index 7c236b6..edbe66a 100644 --- a/dronewars/settings.py +++ b/dronewars/settings.py @@ -47,6 +47,7 @@ INSTALLED_APPS = [ MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", + "whitenoise.middleware.WhiteNoiseMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", @@ -121,6 +122,9 @@ USE_TZ = True # https://docs.djangoproject.com/en/6.0/howto/static-files/ STATIC_URL = "static/" +STATIC_ROOT = BASE_DIR / "staticfiles" +STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage" +WHITENOISE_USE_FINDERS = True REST_FRAMEWORK = { "DEFAULT_AUTHENTICATION_CLASSES": ( diff --git a/frontend/static/frontend/css/home.css b/frontend/static/frontend/css/home.css new file mode 100644 index 0000000..1733020 --- /dev/null +++ b/frontend/static/frontend/css/home.css @@ -0,0 +1,31 @@ +html { + font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", + "Courier New", monospace; +} + +body { + background: radial-gradient(circle at top, #f2f1ea 0%, #e6e1d7 42%, #d8d2c5 100%); + color: #2b2620; + margin: 0; + min-height: 100vh; +} + +.home { + max-width: 960px; + margin: 0 auto; + padding: 96px 24px 80px; +} + +.home h1 { + font-size: clamp(2.4rem, 4vw, 3.6rem); + margin: 0 0 16px; + letter-spacing: -0.03em; +} + +.home p { + font-size: 1.05rem; + line-height: 1.7; + margin: 0; + max-width: 560px; + color: #4a4136; +} diff --git a/frontend/templates/frontend/base.html b/frontend/templates/frontend/base.html index e637e25..c930688 100644 --- a/frontend/templates/frontend/base.html +++ b/frontend/templates/frontend/base.html @@ -3,10 +3,12 @@ + {% load static %} {% block title %}{% endblock %} +