Django Templates 본문
728x90
1. Project Folder/templates Folder
2. Project Folder/settings.py
TEMPLATES_DIR = os.path.join(BASE_DIR, "templates")
TEMPLATES = [
{
'DIRS': [TEMPLATES_DIR,],
}
}
3. AppName/views.py
def funcName(request):
insert_dict = {'key': "contents"}
return render(request, 'html file', context=insert_dict)
4. templates/html file
{{ insert_dict }}
'개발 > Django' 카테고리의 다른 글
Models (0) | 2020.05.05 |
---|---|
Django Static (0) | 2020.05.04 |
Django URL Mappings (0) | 2020.05.04 |
TemplateDoesNotExist (0) | 2020.05.04 |
Django Application (0) | 2020.05.04 |
Comments