Django Learning-Templates

Source: Internet
Author: User

To reduce the redundant code of the template loading call process and the template itself, Django provides a handy and powerful API for loading templates from disk

To use this template to load the API, you first have to tell the framework where to save the template.

The saved file of the set is the settings.pymentioned in the previous section when we described the root_urlconf configuration.

Installed_apps = (    'django_01', #我的项目'Django.contrib.admin',    'Django.contrib.auth',    'Django.contrib.contenttypes',    'django.contrib.sessions',    'django.contrib.messages',    'Django.contrib.staticfiles',)

Add the Templates folder under the project directory

Add an HTML file under this folder

HTML input

The current time is: {{current_date}} This is somewhat similar to the Dtcms template language

Loading templates

Django Learning-Templates

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.