Release date: 2012-4 4Updated on:
Affected Systems:Django CMS 2.xDescription:--------------------------------------------------------------------------------Bugtraq id: 57559Django CMS uses pony as the Technical Support CMS and can be edited at the front end.The page_attribute template tags of earlier versions of django CMS 2.3.5 are not properly filtered. The HTML injection vulnerability exists in the imp
Perform different actions when the list is empty or non-empty: for in list%} ... {empty %} ... {% endfor%}The number of times the loop is accessed using Forloop.counter, which sequentially outputs the number of cycles, starting at 1: for in list%} ... forloop.counter }} ... {% endfor%}Starting from 0 counts: for in list%} ... Forloop.counter0 }} ... {% endfor%}Determine if it is the first cycle: for in list%} ... {ifforloop.first %} is the first round.
HTML> Head> title>DOcumenttitle> Head> Body> H1>{{User}}H1> BR> BR> Li>Method:{{user.say}}Li> Note that there are no brackets behind it. - Body>HTML>2. Modify the views.py file#-*-coding:cp936-*- fromDjango.httpImportHttpResponse#import templates related packages; loader: loader, loading HTML templates fromDjango.templateImportLoader,context#Learn to define the first class in a views.pyclassPerson ():def __init__(self,name,age,sex): Self.name=name S
1. Modify Index pageHTML> Head> title>{{User}}title> Head> Body> H1>Hello {{User}}H1> BR> BR> Li>Hello {{User.Name}}Li> Li>Hello {{user.age}}Li> Li>Hello {{user.sex}}Li> Body>HTML>#-*-coding:cp936-*- fromDjango.httpImportHttpResponse#import templates related packages; loader: loader, loading HTML templates fromDjango.templateImportLoader,context#Learn to define the first class in a views.pyclassPerson ():def __init__(self,name,age,sex):
Filter Format: variable | Upper (filter keyword)1. Index{% for book in user reversed%} {% EMPTY%}{% ENDFOR%}#-*-coding:cp936-*- fromDjango.httpImportHttpResponse fromDjango.templateImportLoader,contextdefIndex (Request): T=loader.get_template ('index.html')Booklist=['python','C + +','Java','PHP']#passing data to an HTML pageC=context ({'User': Booklist}) #Rendering Methodst=T.render (c)returnHttpResponse (t)Django Definition
HTML> Head> title>DOcumenttitle> Head> Body> H1>{{User}}H1> BR> BR> H1>Filter filtersH1> P>1, the use of the Linux pipeline thinkingP> P>2, first the value of book into uppercase, and then converted to lowercase, and then converted to uppercase lettersP>{% for book in user%}Li>{{book | upper |lower | capfirst}}Li>{% empty%}Li>No books foundLi>{% endfor%}Body>HTML>#-*-coding:cp936-*- fromDjango.httpImportHttpResponse fromDjango.templat
Templates href formathref= "{% url ' name ' params%}"Where: Name is the name alias that is configured for a URL in the url.py file, and each parameter specific value of the params URL is used as follows:Add a url,name parameter to the URL of the. py #在url: name= ' app-views-func ' urlpatterns = [URL (r ' ^ (\w+)/(\w+)/(\d+)/delete/$ ', Views.table_delete,name= ' Table_delete '),]#' Table_delete ' 3 2 1%} "#url中有三个参数 (\w+)/(\w+)/(\d+), so pass in three specific parameter values 3 2 1The resulting
To register a blog, you must first solve the style issue. Everyone will select the appropriate style based on their hobbies, but the default template is not necessarily suitable for themselves. I just registered my blog and solved my problem with the template today. When I was so happy, I wrote it down and thought it a
' People5. Person.objects.filter (name__iexact= ' abc ') #名称为abc到那时不区分大小写, can find ABC,ABC,ABC, these are eligible6. Person.objects.filter (name__contains= ' abc ') #名称中包含 ' abc ' People7. Person.objects.filter (name__icontains= ' abc ') #名称中包含 ' abc ', and ABC is case insensitive8. Person.objects.filter (name__regex= "^ABC") #正则表达式查询9. Person.objects.filter (name__iregex= ' ^abc ') #正则表达式不区分大小写Filter is found to meet the conditions, of course, there are also excluded to meet certain condition
For URL files URL (r'^tp1/', VIEWS.TP1)For the views file, jump to tp1.html while uploading the list to the frontdef TP1 (Request): = [1, 2, 3, 4, 5, 6] return'tp1.html', {'list': List})For the inherited file master, the content will be replaced by writing {%block tag%}{%endblock%}"en">"UTF-8"> "stylesheet"href="/static/commons.css">class="pg-content"> Little Boy Management {% block content%}{% Endblock%}Inheritors TP1 First imports through {% extends ' master.html '%} master.htmlTh
Tags: sp bs testing nbsp blog development TemplateBlog Template Development test essayBlog Template Development test essayBlog template development and testingBlog Template Development test essayBlog Template Development test essa
The blog garden supports CSS customization. In the past, it was based on the skin prepared by others. It was inconvenient to make small modifications to achieve the desired effect. During the May Day holiday, I learned the basic usage of CSS and started to try to write a slightly larger CSS code with a custom skin.
Blog garden custom skin of the basic method, is to enter the management background, open the
After continuous improvement, I still feel satisfied with this style.
Next I will post my experiences and methods for later viewing or other new users to check. (Because it is my first time to get things about CSS, it must be very rough. Experts can only entertain themselves or bypass them directly .)
At the overall structure level:
First, the blog garden has a set of top-level CSS styles,
Then, select the CSS style of a
Blog Park codinglife template phone style optimization: With the blog Park to write notes for some time, when I use my mobile phone to browse my article feel the style is not perfect, mainly personal home page and the details of the head width is too large, originally large screen right of the module placed under the article after the width and position is not ap
Dear users:
Hello! According to the requirements of the majority of users, the blog adaptive width template has been launched.Personal Background-blog Configuration. For example:
Template example:
If you find any problems, please send an email to the blog customer serv
Z-blog PHP Version Concise theme template
Features Simple and comfortable
Mobile Mobile-adaptive, perfect for optimization
Code structure facilitates editing
For those who do not understand the code, it is also very suitable for Jane answer background simple answer
PC side bar drop-down follow, no matter how long the following, navigation sidebar are only on the left; easy to select
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.