惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

博客园 - 啊不才

【转载备用】Linux内核编译 幸运的Windows 7 Party 社区活动 jQueryinAction学习笔记——01 - 啊不才 - 博客园 如何在屏幕中央打开一个特定的窗口 KB937061和KB947738多次安装问题 BlogEngine.Net的皮肤 [How Do I]系列学习笔记——001:学习一些技巧 继承类中override和new的区别 我提交的ACM题库的答案 『框架设计(第2版)CLR Via C#』学习笔记——使用is和as操作符来进行强制类型转换 调用Master页面上的属性 NotePad++很好用,但是我真的不想再用它了 BlogEngine的SQL Server数据库配置 关于asp:ScriptManager与Script代码块的位置关系问题 NHiBernate学习笔记(1) 使用JMail.NET时遇到的问题 ToString()方法与Convert.ToString()的差异 『框架设计(第2版)CLR Via C#』学习笔记——常量 【已解决,看后文】使用BlogEngine.net的扩展插件Silverlight Player Extension遇到的问题
django的字符替换问题
啊不才 · 2009-08-31 · via 博客园 - 啊不才

在学习python和Django时(用的是limodou的《Django Step by Step》的第六章),遇到一个问题,就是每次render的都是经过替换的html标签(eg.把‘<’显示为'&lt;'),在网上找到了答案,http://www.javaeye.com/topic/147398,现在把解决方法摘抄如下:

方法一:

原始内容是content,想要对content不进行转义,使用{{content|safe}}就可以关闭了。

方法二:

1 from django.shortcuts import render_to_response
2 from django.utils.safestring import mark_safe
3 
4 def index(request):
5   #
6   context = mark_safe(context)
7   return render_to_response(template_name,{'context':context})