Django --settings configuration in detail

1, templates Configuration

When you create a project in general, it has been configured

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')]
        ,
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

 

 

2, static static configuration file path

Added in settings.py

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static')
]

3, media media file path settings

 

 

Guess you like

Origin www.cnblogs.com/gengyufei/p/12632093.html