<Effective Django>读书笔记

  1. In Django parlance, a project is the final product, and it assembles one
    or more applications together.

  2. Manage.py is a pointer back to Django-admin.py with an environment
    variable set, pointing to your project as the one to read settings from and
    operate on when needed

  3. Settings.py is where you’ll configure your project. It has a few sensible
    defaults, but no database chosen when you start.

  4. Urls.py contains the URL to view mappings.

  5. Wsgi.py is a WSGI wrapper for your application.

  6. Beginning in Django 1.4, apps are placed alongside project packages.

  7. Models.py will contain the Django ORM models for your app.

  8. Views.py will contain the View code

  9. Tests.py will contain the unit and integration tests you write

  10. Django models map to a database table, and provide a place to encapsulate
    business logic. All models subclass the base Model

  11. The INSTALLED_APPS setting lists the applications that the project uses.
    These are listed as strings that map to Python packages. Django will import
    each and looks for a models there.

  12. By default Django will name your tables using a combination of the
    application name and model name.

  13. Django adds an id field as the primary key for your model, unless you
    specify a primary key.

  14. The syncdb manage command creates the tables in your database from
    models.

  15. The model Manager allows you to operate on the collection of instanes:
    querying, creating, etc

  16. Write unit tests for methods you add to the model

  17. The test manage command runs the unit tests.

  18. Django Views take an HTTP Request and return an HTTP Response to the
    user.

  19. Any Python callable can be a view. The only hard and fast requirement is
    that it takes the request object (customarily named request) as its first
    argument.

  20. Generic Views have always provided some basic functionality: render a
    template, redirect, create or edit a model.

  21. The URL configuration tells Django how to match a request’s path to your
    Python code. Django looks for the URL configuration, defined as urlpatterns,
    in the urls.py file in your project.

  22. By default Django will look for templates in applications, as well as in
    directories you specify in settings.TEMPLATE_DIRS.

  23. Most generic views that do form processing have the concept of the
    “success URL”: where to redirect the user when the form is successfully
    submitted.

  24. The collection of values available to a template when it’s rendered is
    referred to as the Context. The Context is a combination of information
    supplied by the view and information from context processors

  25. Django has two tools that are helpful for writing unit tests for views:
    the Test Client and the RequestFactory

  26. The TestClient takes a URL to retrieve, and resolves it against your
    project’s URL configuration. It then creates a test request, and passes that
    request through your view, returning the Response.

  27. Django supports adding static files at both the application and project
    level. Where you add them sort of depends on how tied to your specific
    assembly of apps they are.

  28. App specific static files are stored in the static subdirectory within the
    app. Django will also look in any directories listed in the STATIFFILES_DIRS
    setting.

  29. Django distinguishes between static site files, and user upload
    media.

  30. The staticfiles app is included to help manage static files and serve them
    during development.

  31. Static files can be included with apps, or with the project.

  32. Templates can extend one another, using block tags.

  33. A Django Form is responsible for taking some user input, validating it,
    and turning it into Python objects.

  34. Initial is a dictionary of values that will be used as the default values
    for an unbound form

  35. Forms have two different phases of validation: field and form. All the
    fields are validated and converted to Python objects (if possible) before form
    validation begins.

  36. Form validation takes place in a form’s clean() method

  37. Forms take user input, validate it, and convert it to Python objects.

  38. Django provides 3 types of fields for relating objects to each other:
    ForeignKey for creating one to many relationships, ManyToManyField for
    relating many to many, and OneToOneField for creating a one to one
    relationship.

  39. A FormSet is an object that manages multiple copies of the same Form(or
    ModelForm) in a single page.

<Effective Django>读书笔记

时间: 2024-10-03 07:54:39

<Effective Django>读书笔记的相关文章

码农的产品思维培养第一节(人人都是产品经理读书笔记)

在前段时间,密集的推出Android学习记录之后,我觉得接下来的Android开发进入了一个精进演变的过程,革命性的东西略缺.每日更新特别新的东西也违背认知规律.所以以后关于Android方面的知识,碰到什么,然后记录什么. 而今天,在前一篇日志里面,我描述了我为什么要去理解"产品经理",从这一节开始,我要实施我的计划.所以,和Android记录一样,我要记录这个过程.对自己是一个回归总结吸收的过程,同时也希望能够帮助到更多的朋友,如果你也心存学习进取之心,如果你也如我一般疑惑未解心不

人人都是产品经理读书笔记(四)

补充:

《启示录:打造用户喜爱的产品》—— 读书笔记

这是一本非常不错的书,即使你可能只是一名开发工程师,也会有意想不到的收获! 如果你是一名产品经理,那就更不能错过了!不要留下遗憾! 这真的是一本很好的书,读每一遍都会有不同的收获,绝对让你震撼!我是会再读一遍或者N多遍的, 而能把这些内容转应用到实际中的人才是真正的高手,细细体会,在工作中好像已经有人在用了!惊讶!得抓紧时间了! 通过这本书,你将会知道一个合格的产品经理应该做什么,怎么做 本书主要讲解三个方面:人员.流程.产品 人员:产品从开始到完成过程中所有的参与者 流程:产品在开发过程中的所

产品经理学习笔记(二)------产品经理的工作职责(下)

二.产品经理的工作职责(下) 4.产品宣讲 ---宣讲对象:客服.市场.销售.运营.其他(开发进度到50%) ---宣讲目的:内部培训.获得认可 ---宣讲方式:内部推荐会(预测.演示.试用).注意控制(氛围.引导) ---宣讲目标:获得认可.帮助其他团队更好理解产品.协助其他团队更好开展工作 5.市场推广 ---对产品资料进行内容把关:网站.移动应用.印刷品等 ---主要针对:市场.公关.运营.销售 6.产品推出后的管理与迭代 ---运营数据的整理分析 ---深入一线体验产品 ---关注用户需

产品经理--读书静心的日子

入行教育,做教育产品工作,需要不断的进步. 一.了解产品开发.项目管理经验. 二.教育基础理论及相关知识. 小学阶段 (2016.2017不断的翻阅,有新的体会) 中学阶段(2018主攻方向)

谷歌和亚马逊如何做产品(读书笔记)

《产品经理》读书笔记

自从鼠标手犯病后,就刻意减少使用电脑的时间并且加强运动,目前已经完全康复,但是还是需要注意.因此更新博客的频率大大降低,但是也有时间多看看书,学习学习了! 最近看了<yes,产品经理>上下册,作者 汤圆 老马,文笔诙谐,把管理知识融入工作日常内容,浅显易懂,对于非管理专业的门外汉,还是不错的读物! 下面是摘抄的部分主要内容,个人认为比较有用的就记录下来. ------------------------------------------------ 制定产品价格策略的6步: 确定企业目标 冲

产品经理的那些事第一章读书笔记

1.一个产品经理的信仰:好产品能改变世界. 2.为什么要做产品经理:因为热爱,改变世界的方法有很多,技术可以改变世界,好的产品也可以,当然还有其他,但我热爱产品,一件事只有热爱了,才能持续不断的去做好,所以我选择了产品经理这条路. 3.产品是什么:产品是用来解决某个问题的东西. 4.产品经理为何而设:想要更了解产品与它面临的竞争情况,最终目的是要满足顾客的需求. 5.产品经理概念的进化: 分析: 1)行业形态不同:成熟行业vs.新兴行业 ①传统行业 概况:经过几十年乃至上百年的摸爬滚打,市场已经

【读书笔记】产品经理要做的事

文章链接:http://www.chanpin100.com/archives/44223 作为一个产品经理,不能只画图:产品经理更像是一个纽带,连接着各个环节,保持项目的正常运行. 在开始要做一个产品的时候,不能上来就画图,也不能告诉你需求就开始画图.应该先对需求进行筛选和挖掘:把伪需求去掉,挖掘出潜在需求. 1.分析产品的步骤:目标人群.使用场景.业务核心. 2.在团队中担任掌舵人,有目的的引导团队:激发团队灵感可以使用商业画布:客户分布.价值主张.渠道通路.客户关系.收入来源.核心资源.关

【读书笔记】神一样的产品经理(一)

 第一篇 产品经理 1.产品经理诞生的背景和价值 *很多入门级书里都会提到这一部分,本书讲了保洁诞生的第一个产品经理的故事. 2.很牛的产品经理(例子是乔布斯.郭靖) 1)几个重要特性:*影响力 *核心需求把控力 *创新力 *痴情力 2)产品经理的职责: *明确产品的目标用户群及其特征*获取.评估和管理用户需求*完成产品需求文档.产品原型和流程图*精通用户体验.交互设计和信息架构技能*项目管理.需求变更管理和需求验收*产品运营数据的分析和总结*提供运营.市场和销售等支撑 3)产品经理常犯的错误