Arquivos estáticos (staticfiles), STATIC_URL, STATICFILES_DIRS e load static
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
<!DOCTYPE html>
|
{% load static %}<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Document</title>
|
<title>Document</title>
|
||||||
|
<link rel="stylesheet" href="{% static 'home/css/blue.css' %}">
|
||||||
|
<link rel="stylesheet" href="{% static 'global/css/red.css' %}">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
3
aula207_ola_django/base/static/global/css/red.css
Normal file
3
aula207_ola_django/base/static/global/css/red.css
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
body {
|
||||||
|
background: red;
|
||||||
|
}
|
||||||
3
aula207_ola_django/home/static/home/css/blue.css
Normal file
3
aula207_ola_django/home/static/home/css/blue.css
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
body {
|
||||||
|
background: blue;
|
||||||
|
}
|
||||||
@@ -120,6 +120,9 @@ USE_TZ = True
|
|||||||
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
||||||
|
|
||||||
STATIC_URL = 'static/'
|
STATIC_URL = 'static/'
|
||||||
|
STATICFILES_DIRS = [
|
||||||
|
BASE_DIR / 'base' / 'static'
|
||||||
|
]
|
||||||
|
|
||||||
# Default primary key field type
|
# Default primary key field type
|
||||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
||||||
|
|||||||
Reference in New Issue
Block a user