From 19855e63f89f948d6f6af6474e188adaf36f61dc Mon Sep 17 00:00:00 2001 From: Birkin James Diana Date: Sun, 24 Nov 2024 17:07:39 -0500 Subject: [PATCH 1/6] adds app to installed-apps setting. --- config/settings.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config/settings.py b/config/settings.py index a5f0c5f..6225c1b 100644 --- a/config/settings.py +++ b/config/settings.py @@ -14,8 +14,8 @@ import logging import os import pathlib -from dotenv import load_dotenv, find_dotenv +from dotenv import find_dotenv, load_dotenv ## load envars ------------------------------------------------------ dotenv_path = pathlib.Path(__file__).resolve().parent.parent.parent / '.env' @@ -58,6 +58,7 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'foo_app', ] MIDDLEWARE = [ @@ -165,9 +166,7 @@ 'include_html': True, }, 'logfile': { - 'level': os.environ.get( - 'LOG_LEVEL', 'INFO' - ), # add LOG_LEVEL=DEBUG to the .env file to see debug messages + 'level': os.environ.get('LOG_LEVEL', 'INFO'), # add LOG_LEVEL=DEBUG to the .env file to see debug messages 'class': 'logging.FileHandler', # note: configure server to use system's log-rotate to avoid permissions issues 'filename': os.environ['LOG_PATH'], 'formatter': 'standard', From 550b2915ab98297cf4308f285267658ca8f5f927 Mon Sep 17 00:00:00 2001 From: Birkin James Diana Date: Sun, 24 Nov 2024 17:37:38 -0500 Subject: [PATCH 2/6] updates template to use styles.css --- foo_app/foo_app_templates/info.html | 8 +++++++- foo_app/static/foo_app/styles.css | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 foo_app/static/foo_app/styles.css diff --git a/foo_app/foo_app_templates/info.html b/foo_app/foo_app_templates/info.html index 190de5a..504b0ae 100644 --- a/foo_app/foo_app_templates/info.html +++ b/foo_app/foo_app_templates/info.html @@ -1,3 +1,5 @@ +{% load static %} + @@ -5,6 +7,9 @@ Information Page - {{ message }} + + +
diff --git a/foo_app/static/foo_app/styles.css b/foo_app/static/foo_app/styles.css new file mode 100644 index 0000000..e783157 --- /dev/null +++ b/foo_app/static/foo_app/styles.css @@ -0,0 +1,22 @@ +body { + font-family: 'Trebuchet MS', sans-serif; + background-color: #f0f0f0; + margin: 0; + height: 100vh; + font-size: 1rem; +} +.container { + background-color: #fff; + padding: 1.25rem; /* Equivalent to 20px if base font-size is 16px */ + border-radius: 0.5rem; + box-shadow: 0 0 0.625rem rgba(0, 0, 0, 0.1); + width: 80%; + max-width: 37.5rem; + margin: calc(100vh / 4) auto 0 auto; +} +.parenthetical { + font-size: 0.75rem; + color: #666; + margin-top: 2rem; + font-style: italic; +} From ddecb83ed98b3dd2bdd057038bd9c499b290e5ea Mon Sep 17 00:00:00 2001 From: Birkin James Diana Date: Sun, 24 Nov 2024 17:51:16 -0500 Subject: [PATCH 3/6] moves styles.css to correct directory. --- foo_app/static/foo_app/{ => css}/styles.css | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename foo_app/static/foo_app/{ => css}/styles.css (100%) diff --git a/foo_app/static/foo_app/styles.css b/foo_app/static/foo_app/css/styles.css similarity index 100% rename from foo_app/static/foo_app/styles.css rename to foo_app/static/foo_app/css/styles.css From 6d3ba66854980d09a424526bb9872a435ca17f65 Mon Sep 17 00:00:00 2001 From: Birkin James Diana Date: Sun, 24 Nov 2024 17:51:35 -0500 Subject: [PATCH 4/6] updates dotenv-example. --- config/dotenv_example_file.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/dotenv_example_file.txt b/config/dotenv_example_file.txt index 0ef0b92..a2a1539 100644 --- a/config/dotenv_example_file.txt +++ b/config/dotenv_example_file.txt @@ -33,7 +33,7 @@ DATABASES_JSON=' ' STATIC_URL="/static/" -STATIC_ROOT="/static/" +STATIC_ROOT="/path/to/some/apache-served/html/dir/" # used by collectstatic; not used by runserver. SERVER_EMAIL="donotreply_foo-project@domain.edu" EMAIL_HOST="localhost" From bc6a6ab9f2864a044894891bf00e160f62384d8d Mon Sep 17 00:00:00 2001 From: Birkin James Diana Date: Sun, 24 Nov 2024 17:52:03 -0500 Subject: [PATCH 5/6] adds info-comment to template. --- foo_app/foo_app_templates/info.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/foo_app/foo_app_templates/info.html b/foo_app/foo_app_templates/info.html index 504b0ae..5720ac2 100644 --- a/foo_app/foo_app_templates/info.html +++ b/foo_app/foo_app_templates/info.html @@ -5,10 +5,11 @@ - Information Page - {{ message }} + Information Page +