From dc90353228259c4d1d2d022ad8b49bc7d0d05309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Fri, 21 Apr 2023 09:14:54 -0300 Subject: [PATCH] =?UTF-8?q?Arquivos=20est=C3=A1ticos=20(staticfiles),=20ST?= =?UTF-8?q?ATIC=5FURL,=20STATICFILES=5FDIRS=20e=20load=20static?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula207_ola_django/base/global/partials/head.html | 4 +++- aula207_ola_django/base/static/global/css/red.css | 3 +++ aula207_ola_django/home/static/home/css/blue.css | 3 +++ aula207_ola_django/project/settings.py | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 aula207_ola_django/base/static/global/css/red.css create mode 100644 aula207_ola_django/home/static/home/css/blue.css diff --git a/aula207_ola_django/base/global/partials/head.html b/aula207_ola_django/base/global/partials/head.html index 48f7ba0..f610ad4 100644 --- a/aula207_ola_django/base/global/partials/head.html +++ b/aula207_ola_django/base/global/partials/head.html @@ -1,9 +1,11 @@ - +{% load static %} Document + + \ No newline at end of file diff --git a/aula207_ola_django/base/static/global/css/red.css b/aula207_ola_django/base/static/global/css/red.css new file mode 100644 index 0000000..67ce83e --- /dev/null +++ b/aula207_ola_django/base/static/global/css/red.css @@ -0,0 +1,3 @@ +body { + background: red; +} diff --git a/aula207_ola_django/home/static/home/css/blue.css b/aula207_ola_django/home/static/home/css/blue.css new file mode 100644 index 0000000..ae844dc --- /dev/null +++ b/aula207_ola_django/home/static/home/css/blue.css @@ -0,0 +1,3 @@ +body { + background: blue; +} diff --git a/aula207_ola_django/project/settings.py b/aula207_ola_django/project/settings.py index ca92270..79ee056 100644 --- a/aula207_ola_django/project/settings.py +++ b/aula207_ola_django/project/settings.py @@ -120,6 +120,9 @@ USE_TZ = True # https://docs.djangoproject.com/en/4.2/howto/static-files/ STATIC_URL = 'static/' +STATICFILES_DIRS = [ + BASE_DIR / 'base' / 'static' +] # Default primary key field type # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field