Django 中的render
来源:互联网 发布:mac使用windows软件 编辑:程序博客网 时间:2024/06/05 05:27
render(request, template_name, context=None, content_type=None, status=None, using=None)
Returns a HttpResponse whose content is filled with the result of calling django.template.loader.render_to_string() with the passed
request: 收到的请求
template_name: templates 中网页模板. 比如’templates\learn\index.html’, 参数就要写‘learn\index.html’
context: 要传入文件中用于渲染呈现的数据, 默认是字典格式
content_type: 生成的文档要使用的MIME 类型。默认为DEFAULT_CONTENT_TYPE 设置的值。
status: http的响应代码,默认是200.
using: 用于加载模板使用的模板引擎的名称。
常见的MIME类型(通用型):
超文本标记语言文本 .html text/html
xml文档 .xml text/xml
XHTML文档 .xhtml application/xhtml+xml
普通文本 .txt text/plain
RTF文本 .rtf application/rtf
PDF文档 .pdf application/pdf
Microsoft Word文件 .word application/msword
PNG图像 .png image/png
GIF图形 .gif image/gif
JPEG图形 .jpeg,.jpg image/jpeg
au声音文件 .au audio/basic
MIDI音乐文件 mid,.midi audio/midi,audio/x-midi
RealAudio音乐文件 .ra, .ram audio/x-pn-realaudio
MPEG文件 .mpg,.mpeg video/mpeg
AVI文件 .avi video/x-msvideo
GZIP文件 .gz application/x-gzip
TAR文件 .tar application/x-tar
任意的二进制数据 application/octet-stream
- Django 中的render
- django render和render_to_response()
- Django的render方法
- Django-restframework16 Render
- Ogre中的render queue
- Jfinal中的render
- Rails Controller中的 render
- Django的render(模板渲染)机制
- Django中render和render_to_response的区别
- django中render()与render_to_response()区别
- [Django模板系统]Django的模板渲染(render)机制
- 【django】django render()和render_to_response()和direct_to_template()和locals()
- OpenGL 中的 Render To Texture
- WebCore中的Dom和Render
- Ogre中的render to texture.
- jQuery LigerUi 中的render使用
- React中的render何时执行
- vue---Vue2.x中的Render函数,render核心函数createElement()
- 商人的诀窍
- Quagga Routing Suite
- 自编码器原理以及相关算法 Basic Auto-Encoder,Regularized Auto-Encoder,Denoising Auto-Encoder
- 【架构】Top 10 Tips on Logging in Java
- 字符流与字节流练习
- Django 中的render
- 递归的函数
- Springmvc table搜索在本页显示加分页
- 安装VS2017的一些小事情
- Aria2 使用手札
- PAT1002. 写出这个数 (20)
- Ajax---05--Ajax的get与post
- Unity 3D
- 水仙花数