Django static configuration files and template files

Let's look at a static file django template file has been how it is configured, first of all, we create a project after project, we first need to do two things

  1. Configuration template directory (already configured)
  2. Static configuration directory (in settings.py file in the last line of their allocation)

1, a static configuration file directory

Description: Configure a static directory settings.py file in the last line item under the project

= STATICFILES_DIRS ( 
    os.path.join (base_dir, "static"), # here the best static directory name with static, and finally need to add a comma, otherwise it will error 
)

 

Guess you like

Origin www.cnblogs.com/meihan/p/12409462.html