Flask the most storming-with Dragonfire learn Flask-the second piece of Flask in the Render Redirect HttpResponse

Source: Internet
Author: User

HttpResponse in 1.Flask

The HttpResponse in flask, in our view, is actually a direct return string.

REDIRECT in 2.Flask

Whenever the address "/redi" is accessed, the View function Redi will trigger redirect ("/") to jump to the URL address: "/" and will trigger the "/" Corresponding view function index ()

Render (Render_template) in 3.Flask

HTML template rendering is a must in every web framework, as for the specific use of render_template, leave a suspense, look back

Note: If you want to return the rendered template using Render_template, add a directory to the project's home directory templates

Otherwise, there might be a JINJA2 exception.

The problem is basically the path of your template.

End of the second article

Flask the most storming-with Dragonfire learn Flask-the second piece of Flask in the Render Redirect HttpResponse

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.