[PYTHON] Django tutorial summary for beginners by beginners ⑥ (static file)

Introduction

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)

Creating your first Django app, part 6

https://docs.djangoproject.com/ja/3.0/intro/tutorial06/

Customize the structure of your app

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' %}">

Add background image

Images also create polls / static / polls / images and save it in it.

Recommended Posts

Django tutorial summary for beginners by beginners ⑥ (static file)
Django tutorial summary for beginners by beginners ③ (View)
Django tutorial summary for beginners by beginners ⑤ (test)
Django tutorial summary for beginners by beginners ⑦ (Customize Admin)
Django Tutorial Summary for Beginners by Beginners (Model, Admin)
Django tutorial summary for beginners by beginners ① (project creation ~)
Django tutorial summary for beginners by beginners ④ (Generic View)
Django static file (static) related settings summary
Python Django tutorial summary
Reference resource summary (for beginners)
[Explanation for beginners] TensorFlow tutorial MNIST (for beginners)
Machine learning summary by Python beginners
[For beginners] Django -Development environment construction-
What is scraping? [Summary for beginners]
TensorFlow Tutorial MNIST For ML Beginners
Django Girls Tutorial Summary First Half
Pandas basics summary link for beginners
[Deprecated] Chainer v1.24.0 Tutorial for beginners
TensorFlow Tutorial -MNIST For ML Beginners
Summary of restrictions by file system
[Explanation for beginners] TensorFlow tutorial Deep MNIST
Django Summary
[Linux command summary] Command list [Must-see for beginners]
Django Summary
Linux operation for beginners Basic command summary
A textbook for beginners made by Python beginners
About Nim higher-order functions for Nim beginners written by Nim beginners
Put the file uploaded by django into MinIO
Conducting the TensorFlow MNIST For ML Beginners Tutorial
[Django] About static file related settings (images, videos)
[Django] About static file related settings (css, js)
Roadmap for beginners
Python Django Tutorial (5)
Python Django Tutorial (2)
Python tutorial summary
Django 1.9 for internationalization
django tutorial memo
Python Django Tutorial (8)
Python Django Tutorial (6)
Start Django Tutorial 1
Django filter summary
Python Django Tutorial (7)
Python Django Tutorial (1)
Python Django tutorial tutorial
Python Django Tutorial (3)
Python Django Tutorial (4)
I tried the MNIST tutorial for beginners of tensorflow.
Summary of pre-processing practices for Python beginners (Pandas dataframe)
Read the xml file by referring to the Python tutorial
[Linux] Basics of authority setting by chmod for beginners
[For beginners] Django Frequently used commands and reference collection