In web. py, call the template method in the folder, web. py Template

Source: Internet
Author: User

In web. py, call the template method in the folder, web. py Template

The web. py template is very easy to use, but sometimes we need to perform directory level for management. How to use a directory-level template?

We usually declare the template folder before using the template.
Copy codeThe Code is as follows:
Render = web. template. render ('templates ')

Use the templatesfolder index.html Template
Copy codeThe Code is as follows:
Return render. index ()

Use the templatesfolder list.html Template
Copy codeThe Code is as follows:
Return render. list ()

All the preceding html template files are only stored in the tempates directory. To create a directory under the templates directory and use the template file under the directory, you only need to add the directory name.
Use the index.html template in the admindirectory under templates
Copy codeThe Code is as follows:
Return render. admin. index ()

Use the login.html template in the admindirectory under templates
Copy codeThe Code is as follows:
Return render. admin. login ()


Ppt is the design template in the Web folder of all slide applications.

If you use version 2003 for the question, you can perform the following operations:
Click "format" ---- "slide design" (a pane is displayed on the right of the window)
Click "design template" (this is in the displayed pane. You can find it)
Click "Browse" (you can see it at the bottom of the pane)
Then select the location of the template required in the question on the computer.
The operation is complete.

Where is the template folder in the website template file? How can I use the template?

We recommend that you search "Templates" or "Template" in the search bar of your computer. Most software uses the name "Templates" to create a Template folder. The number of "Templates" folders listed in different programs is different. There should be many "Templates" in your search box. Then, open "Templates" and find the Templates you need. If the discuz Template you mentioned does have a "Template", you can find it.

Related Article

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.