Create Static Files and Templates

Create Static & Template Directory

In your project directory, create a folder named static and templates as mentioned in your settings.py file.

Static Directory

  1. Inside static, create a subfolder for images and css:
     
  2. Add any image to the images folder like I have done in this example.

Templates Directory

  1. Similarly inside templates, create a folder named home:

  2. Add HTML code to home.html that you want to render as your home page: 

Here {% load static %} is used to load the static tag that will load static files from our static directory, it will give path of the static files from the settings.py's configurations to all the places where you use static tag.

Discussion

13

0