Skip to content

Commit 37a9aa1

Browse files
author
ictar
committed
add faq for python official documentation and "internationlization and
localization" overview for django
1 parent d6907d6 commit 37a9aa1

6 files changed

Lines changed: 301 additions & 2 deletions

File tree

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
# Django 文档
2+
3+
原文: [Django documentation](https://docs.djangoproject.com/en/1.9/)
4+
5+
---
6+
7+
你所需要知道的关于Django的一切。
8+
9+
## 该文档如何组织¶
10+
11+
Django has a lot of documentation. A high-level overview of how it’s organized will help you know where to look for certain things:
12+
13+
* [Tutorials](https://docs.djangoproject.com/en/1.9/intro/) take you by the hand through a series of steps to create a Web application. Start here if you’re new to Django or Web application development. Also look at the “First steps” below.
14+
* [Topic guides](https://docs.djangoproject.com/en/1.9/topics/) discuss key topics and concepts at a fairly a fairly high level and provide useful background information and explanation.
15+
* [Reference guides](https://docs.djangoproject.com/en/1.9/ref/) contain technical reference for APIs and other aspects of Django’s machinery. They describe how it works and how to use it but assume that you have a basic understanding of key concepts.
16+
* [How-to guides](https://docs.djangoproject.com/en/1.9/howto/) are recipes. They guide you through the steps involved in addressing key problems and use-cases. They are more advanced than tutorials and assume some knowledge of how Django works.
17+
18+
19+
----------
20+
21+
22+
## 第一步¶
23+
24+
你是Django或者编程的新手?这里就是开始的地方!
25+
26+
* **From scratch**: Overview | Installation
27+
* **Tutorial: Part 1**: Requests and responses | Part 2: Models and the admin site | Part 3: Views and templates | Part 4: Forms and generic views | Part 5: Testing | Part 6: Static files | Part 7: Customizing the admin site
28+
* **Advanced Tutorials**: How to write reusable apps | Writing your first patch for Django
29+
30+
31+
----------
32+
33+
34+
## 模型层¶
35+
36+
Django provides an abstraction layer (the “models”) for structuring and manipulating the data of your Web application. Learn more about it below:
37+
38+
* **Models**: Introduction to models | Field types | Meta options | Model class
39+
* **QuerySets**: Executing queries | QuerySet method reference | Lookup expressions
40+
* **Model instances**: Instance methods | Accessing related objects
41+
* **Migrations**: Introduction to Migrations | Operations reference | SchemaEditor | Writing migrations
42+
* **Advanced**: Managers | Raw SQL | Transactions | Aggregation | Custom fields | Multiple databases | Custom lookups | Query Expressions | Conditional Expressions | Database Functions
43+
* **Other**: Supported databases | Legacy databases | Providing initial data | Optimize database access | PostgreSQL specific features
44+
45+
46+
----------
47+
48+
49+
## 视图层¶
50+
51+
Django has the concept of “views” to encapsulate the logic responsible for processing a user’s request and for returning the response. Find all you need to know about views via the links below:
52+
53+
* **The basics**: URLconfs | View functions | Shortcuts | Decorators
54+
* **Reference**: Built-in Views | Request/response objects | TemplateResponse objects
55+
* **File uploads**: Overview | File objects | Storage API | Managing files | Custom storage
56+
* **Class-based views**: Overview | Built-in display views | Built-in editing views | Using mixins | API reference | Flattened index
57+
* **Advanced**: Generating CSV | Generating PDF
58+
Middleware: Overview | Built-in middleware classes
59+
60+
61+
----------
62+
63+
64+
## 模板层¶
65+
66+
模板层提供用于渲染要呈现给用户的信息的设计者友好语法。了解设计师如何使用这一语法师以及如何通过编程进行扩展:
67+
68+
* **The basics**: Overview
69+
* **For designers**: Language overview | Built-in tags and filters | Humanization
70+
* **For programmers**: Template API | Custom tags and filters
71+
72+
73+
----------
74+
75+
76+
## 表单¶
77+
78+
Django提供了一个丰富的框架,以帮助创建表格和操作表格数据。
79+
80+
* **The basics**: Overview | Form API | Built-in fields | Built-in widgets
81+
* **Advanced**: Forms for models | Integrating media | Formsets | Customizing validation
82+
83+
84+
----------
85+
86+
87+
## 开发过程¶
88+
89+
了解各种组件和工具,以助您进行Django应用程序的开发和测试:
90+
91+
* **设置**: [概述](https://docs.djangoproject.com/en/1.9/topics/settings/) | Full list of settings
92+
* **应用**: [概述](https://docs.djangoproject.com/en/1.9/ref/applications/)
93+
* **异常**: [概述](https://docs.djangoproject.com/en/1.9/ref/exceptions/)
94+
* **django-admin 和 manage.py**: [概述](https://docs.djangoproject.com/en/1.9/ref/django-admin/) | Adding custom commands
95+
* **测试**: [简介](https://docs.djangoproject.com/en/1.9/topics/testing/) | Writing and running tests | Included testing tools | Advanced topics
96+
* **部署**: [概述](https://docs.djangoproject.com/en/1.9/howto/deployment/) | WSGI servers | Deploying static files | Tracking code errors by email
97+
98+
99+
----------
100+
101+
102+
## admin站点¶
103+
104+
所有你所需要知道的自动管理接口,Django最流行的功能之一:
105+
106+
* [Admin站点](https://docs.djangoproject.com/en/1.9/ref/contrib/admin/)
107+
* [Admin动作](https://docs.djangoproject.com/en/1.9/ref/contrib/admin/actions/)
108+
* [Admin文档生成器](https://docs.djangoproject.com/en/1.9/ref/contrib/admin/admindocs/)
109+
110+
111+
----------
112+
113+
114+
## 安全¶
115+
116+
安全性是至关重要的Web应用程序的开发主题,Django提供多种保护手段和机制:
117+
118+
* [安全概述](https://docs.djangoproject.com/en/1.9/topics/security/)
119+
* [Django已披露的安全问题](https://docs.djangoproject.com/en/1.9/releases/security/)
120+
* [点击劫持保护](https://docs.djangoproject.com/en/1.9/ref/clickjacking/)
121+
* [跨站请求伪造保护](https://docs.djangoproject.com/en/1.9/ref/csrf/)
122+
* [加密签名](https://docs.djangoproject.com/en/1.9/topics/signing/)
123+
* [安全中间件](https://docs.djangoproject.com/en/1.9/ref/middleware/#security-middleware)
124+
125+
126+
----------
127+
128+
129+
## 国际化和本地化¶
130+
131+
Django还提供了一个强大的国际化和本地化的框架,以帮助您的用于多国语言和世界各地区的应用的发展:
132+
133+
* [概述](./国际化和本地化.md) | [国际化](https://docs.djangoproject.com/en/1.9/topics/i18n/translation/) | [本地化](https://docs.djangoproject.com/en/1.9/topics/i18n/translation/#how-to-create-language-files) | [本地的Web用户界面格式及表单输入](https://docs.djangoproject.com/en/1.9/topics/i18n/formatting/)
134+
* [时区](https://docs.djangoproject.com/en/1.9/topics/i18n/timezones/)
135+
136+
137+
----------
138+
139+
140+
## 性能和优化¶
141+
142+
有各种各样的技术和工具,可以帮助你的代码的运行更有效率 - 速度更快,并且使用更少的系统资源。
143+
144+
* [性能和优化概述](https://docs.djangoproject.com/en/1.9/topics/performance/)
145+
146+
147+
----------
148+
149+
150+
##Python兼容性¶
151+
152+
Django的目标是兼容不同Python风味及版本:
153+
154+
* [Jython的支持](https://docs.djangoproject.com/en/1.9/howto/jython/)
155+
* [Python 3 兼容性](https://docs.djangoproject.com/en/1.9/topics/python3/)
156+
157+
158+
----------
159+
160+
161+
## 地理框架¶
162+
163+
[GeoDjango](https://docs.djangoproject.com/en/1.9/ref/contrib/gis/)意图成为一个世界级的地理Web框架。它的目标是尽可能容易地构建GIS Web应用程序,并加强空间功能数据的能力。
164+
165+
166+
----------
167+
168+
169+
## 常见的Web应用程序的工具¶
170+
171+
Django还提供了多种通常在Web应用程序开发过程中需要的工具:
172+
173+
* **认证**: Overview | Using the authentication system | Password management | Customizing authentication | API Reference
174+
* [Caching]()
175+
* [Logging]()
176+
* [Sending emails]()
177+
* [Syndication feeds (RSS/Atom)]()
178+
* [Pagination]()
179+
* [Messages framework]()
180+
* [Serialization]()
181+
* [Sessions]()
182+
* [Sitemaps]()
183+
* [Static files management]()
184+
* [Data validation]()
185+
186+
187+
----------
188+
189+
190+
##其他核心功能¶
191+
192+
了解Django框架的其他一些核心功能:
193+
194+
* [Conditional content processing]()
195+
* [Content types and generic relations]()
196+
* [Flatpages]()
197+
* [Redirects]()
198+
* [Signals]()
199+
* [System check framework]()
200+
* [The sites framework]()
201+
* [Unicode in Django]()
202+
203+
204+
----------
205+
206+
207+
## Django的开源项目¶
208+
209+
了解了Django项目本身以及您如何参与到开发过程:
210+
211+
* **社区**: How to get involved | The release process | Team organization | Meet the team | Current roles | The Django source code repository | Security policies | Mailing lists
212+
* **设计理念**: Overview
213+
* **文档**: About this documentation
214+
* **第三方发行版本**: Overview
215+
* **Django over time**: API stability | Release notes and upgrading instructions | Deprecation Timeline
216+
217+
218+
219+
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# 国际化和本地化
2+
3+
原文: [Internationalization and localization](https://docs.djangoproject.com/en/1.9/topics/i18n/)
4+
5+
---
6+
7+
## 概述¶
8+
9+
国际化和本地化的目标是,允许一个单一的Web应用程序提供适合用户的语言和格式的内容。
10+
11+
Django has full support for translation of text, formatting of dates, times and numbers, and time zones.Django完全支持[文本翻译](https://docs.djangoproject.com/en/1.9/topics/i18n/translation/),[日期,时间和数字格式](https://docs.djangoproject.com/en/1.9/topics/i18n/formatting/),以及[时区](https://docs.djangoproject.com/en/1.9/topics/i18n/timezones/)。
12+
13+
从本质上讲,Django做了两件事:
14+
15+
* 它允许开发者和模板的作者指定应用程序的某些部分应该为当地的语言和文化进行翻译或格式化。
16+
* 根据特定用户的喜好,使用这些钩子来对Web应用程序进行本地化。
17+
18+
显然,翻译取决于目标的语言和格式,通常取决于目标国家。此信息通过报头的**Accept-Language**属性,由浏览器提供。然而,并不容易获得时区。
19+
20+
21+
----------
22+
23+
24+
## 定义¶
25+
26+
词语“国际化”和“本土化”,往往会造成混乱; 这里有一个简单的定义:
27+
28+
**国际化**
29+
准备用于本地化的软件,通常由开发者完成。
30+
31+
**本地化**
32+
编写翻译及本地格式。通常由翻译器完成。
33+
34+
更多详细信息,见[W3网络国际化FAQ](http://www.w3.org/International/questions/qa-i18n), [维基百科的文章](https://en.wikipedia.org/wiki/Internationalization_and_localization)或[GNU gettext文档](https://www.gnu.org/software/gettext/manual/gettext.html#Concepts)。
35+
36+
> 警告
37+
38+
> 翻译和格式化通过[USE_I18N](https://docs.djangoproject.com/en/1.9/ref/settings/#std:setting-USE_I18N)和[USE_L10N](https://docs.djangoproject.com/en/1.9/ref/settings/#std:setting-USE_L10N)设置项分别设置。然而,这两种功能都包括国际化和本地化。设置项的名字是Django历史上的一个不幸的结果。
39+
40+
这里有一些其他术语,以助于我们处理一个共同的语言:
41+
42+
**区域设置名称**
43+
语言环境的名称,或者是由**ll**形式或者由语言和指定国家组成的**ll_CC**形式指定的语言例如: **it**, **de_AT**, **es**, **pt_BR**。语言部分始终是小写,而国家部分始终是大写。分隔符是下划线。
44+
45+
**语言代码**
46+
代表一种语言的名字。浏览器使用这种格式来发送它们在**Accept-Language**报头接收的语言的名称。例如:**it**, **de-at**, **es**, **pt-br**。语言代码通常用小写表示,但是HTTP **Accept-Language**报头不区分大小写。其分隔符是一个破折号。
47+
48+
**消息文件**
49+
一个信息文件是一个纯文本文件,它代表一种语言,其包含了所有可用的[翻译字符串](https://docs.djangoproject.com/en/1.9/topics/i18n/#term-translation-string),以及应如何在给定的语言中展示。消息文件具有**.po**文件扩展名。
50+
51+
**翻译字符串**
52+
可翻译文字。
53+
54+
**格式化文件**
55+
格式化文件是为给定的语言环境定义数据格式的Python模块。
56+
57+
58+
59+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Django Official documentation
2+
3+
[Django官方](https://www.djangoproject.com/)文档
4+
5+
# 目录说明
6+
1. [1.9](./1.9/) Django 1.9版本官方文档
7+
8+

‎Python Official documentation/3.5.1/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ tutorial for C/C++ programmers
3434
[Python/C API](https://docs.python.org/3/c-api/index.html)
3535
reference for C/C++ programmers
3636

37-
[FAQs](https://docs.python.org/3/faq/index.html)
37+
[FAQs](./faq)
3838
frequently asked questions (with answers!)
3939

4040
**Indices and tables:**
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Python常见问题集
2+
3+
原文: [Python Frequently Asked Questions](https://docs.python.org/3/faq/index.html)
4+
5+
* [Python一般问题 FAQ](https://docs.python.org/3/faq/general.html)
6+
* [编程类FAQ](https://docs.python.org/3/faq/programming.html)
7+
* [设计和历史类 FAQ](https://docs.python.org/3/faq/design.html)
8+
* [库及扩展类 FAQ](https://docs.python.org/3/faq/library.html)
9+
* [扩展/嵌入类 FAQ](https://docs.python.org/3/faq/extending.html)
10+
* [Windows上的Python FAQ](https://docs.python.org/3/faq/windows.html)
11+
* [图形用户界面 FAQ](https://docs.python.org/3/faq/gui.html)
12+
* [“为什么在我的电脑上安装Python?” FAQ](https://docs.python.org/3/faq/installed.html)

‎README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ translate python documents to Chinese for convenient reference
1111

1212
# 目录说明
1313
1. [Python Official documentation](./Python Official documentation/) python 官方文档
14-
2. [Others](./Others/) 其他零零碎碎的Python文档
14+
2. [Django Official documentation](./Django Official documentation/) python 官方文档
15+
3. [Others](./Others/) 其他零零碎碎的Python文档
1516

0 commit comments

Comments
 (0)