《Django by Example》中文版

《Django by Example》中文版

1 / 294 《Django By Example》中文版 目录 ...................................................................................................................................................................................................... 1 《Django By Example》中文版 ............................................................................................................................................. 2 第一章 创建一个 blog 应用 ....................................................................................................................................................... 8 安装 Django ......................................................................................................................................................................... 8 创建一个独立的 Python 环境 ............................................................................................................................................ 8 使用 pip 安装 Django ......................................................................................................................................................... 9 创建你的第一个项目 .......................................................................................................................................................... 9 运行开发服务器 ................................................................................................................................................................ 10 项目设置 ............................................................................................................................................................................ 11 项目和应用 ........................................................................................................................................................................ 12 创建一个应用 .................................................................................................................................................................... 12 设计 blog 数据架构 ........................................................................................................................................................... 12 激活你的应用 .................................................................................................................................................................... 14 创建和进行数据库迁移 .................................................................................................................................................... 14 为你的模型(models)创建一个管理站点 .................................................................................................................... 15 创建一个超级用户 ............................................................................................................................................................ 15 Django 管理站点 ............................................................................................................................................................... 16 在管理站点中添加你的模型(models) ........................................................................................................................ 16 定制 models 的展示形式 .................................................................................................................................................. 17 使用查询集(QuerySet)和管理器(managers)........................................................................................................ 18 创建对象 ............................................................................................................................................................................ 19 更新对象 ............................................................................................................................................................................ 19 取回对象 ............................................................................................................................................................................ 20 使用 filter()方法 ................................................................................................................................................................ 20 使用 exclude() .................................................................................................................................................................... 20 使用 order_by() ................................................................................................................................................................. 20 删除对象 ............................................................................................................................................................................ 21 查询集(QuerySet)什么时候会执行 ............................................................................................................................ 21 创建 model manager ......................................................................................................................................................... 21 构建列和详情视图(views) ........................................................................................................................................... 21 创建列和详情 views .......................................................................................................................................................... 22 为你的视图(views)添加 URL 模式 ............................................................................................................................. 22 模型(models)的标准 URLs ......................................................................................................................................... 23 为你的视图(views)创建模板(templates) ............................................................................................................... 24 添加页码 ............................................................................................................................................................................ 26 使用基于类的视图(views) ........................................................................................................................................... 28 总结 ............................................................................................................................................................................................ 28 译者总结 ............................................................................................................................................................................ 29 第二章 用高级特性来增强你的 blog ...................................................................................................................................... 29 通过 email 分享帖子 ................................................................................................................................................. 29 使用 Django 创建表单 .............................................................................................................................................. 29 在视图(views)中操作表单 ................................................................................................................................... 30 使用 Django 发送 email.................................................................................................................................................... 31 在模板(templates)中渲染表单 .................................................................................................................................... 32 2 / 294 创建一个评论系统 ............................................................................................................................................................ 35 通过模型(models)创建表单 ........................................................................................................................................ 36 在视图(views)中操作 ModelForms ............................................................................................................................. 36 在帖子详情模板(template)中添加评论 ..................................................................................................................... 38 增加标签(tagging)功能 ................................................................................................................................................ 40 检索类似的帖子 ................................................................................................................................................................ 44 总结 .................................................................................................................................................................................... 45 第三章 扩展你的 blog 应用 .................................................................................................................................................... 46 创建自定义的模板标签(template tags)和过滤器(filters) ........................................................................... 46 创建自定义的模板标签(template tags) ........................................................................................................... 46 创建自定义的模板过滤器(template filters) .................................................................................................... 50 为你的站点添加一个站点地图(sitemap) ......................................................................................................... 51 为你的 blog 帖子创建 feeds .................................................................................................................................. 54 使用 Solr 和 Haystack 添加一个搜索引擎 ........................................................................................................... 55 安装 Solr ..................................................................................................................................................................

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    294 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us