This article is a series of steps through Django's official tutorials. This time, we'll move on to the fourth article, "Creating your first Django app, part 6."
Django tutorial summary for beginners by beginners ① (project creation ~) Django tutorial summary for beginners by beginners ② (Model, Admin) Django tutorial summary for beginners by beginners ③ (View) Django tutorial summary for beginners by beginners ④ (Generic View) Django tutorial summary for beginners by beginners ⑤ (test) Django tutorial summary for beginners by beginners ⑥ (static file) Summary of Django tutorials for beginners by beginners ⑦ (Customize Admin)
https://docs.djangoproject.com/ja/3.0/intro/tutorial06/
In Django, static files are created in polls (app name) / static
.
Let's actually create a style sheet.
polls/static/polls/style.css
li a {
color: green;
}
Import this stylesheet into ʻindex.html`.
polls/templates/polls/index.html
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'polls/style.css' %}">
Images also create polls / static / polls / images
and save it in it.
Recommended Posts