Django fragmentation (4): Jump Function

Source: Internet
Author: User

1. request and response objects

See https://docs.djangoproject.com/en/1.2/ref/request-response/

Django book

Learning notes will be learned. Today's focus is on redirect (HttpResponseRedirect)

Ii. Jump function:

It can be implemented in the background and in the foreground.

1. Background:

ClassHttpResponseRedirect:

Remember to import this module before using it,HttpResponseRedirectThe constructor accepts a parameter, which can be a complete url or an absolute path.

1 return HttpResponseRedirect ("http://www.yahoo.com/search/") 2 ------------------- or -------------------- 3 return HttpResponseRedirect ("/queryNews /")

Note,If the absolute path is missing and the front backslash is used, for example, return HttpResponseRedirect ("queryNews"), the queryNews path under this path is redirected.

For example: http: // 127.0.0.1: 8000/add_English/queryNews

2. Front-end:

Read: http://www.cnblogs.com/aszx0413/articles/1886819.html

 

 

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.