第二天学英语:django 第二章 get started(1)

声明:我学英语用的,文章不适合大家看。

Chapter Two : Getting Started


New to Django? Or to web development in general ? Well,you came to the right place : read this material to quickly get up and running.
django新手?或者开发普通web网站,那么,你来对地方了,读这个教材可以快速搭建起来运行。
 
2.1 Django at a glance (初看 django)
 
Because Django was developed in a fast-paced newsroom enviroment,it was designed to make common Web-development tasks fast and easy .Here's an informal overview of how to write a database-driven Web-app with Django.
django是用来快速开发的新闻编辑环境,它被设计作为快速简单的开发通用web,这里有一个非正式的介绍关于django的数据库驱动模块。
 
The goal of this document is to give you enough technical specifics to understand how Django works,bu this isn't intended to be a tutorial or reference- but we've got both!When you're ready to start a project ,you can start with the tutorial or dive right into(切入) more detailed documentation.
这个文档的目的是让你知道django怎么运行的细节,但这个不是一个帮助手册或者参考资料,但我们都有!你准备好后,你可以从指导手册或者切入详细的文档。
 
2.1.1 Design your model 设计你的模型
Although you can use Django without a database , it comes with an object-relational mapper in which you describe your database layout in Python code.
即使你可以在使用django时不适用数据库,它从Python代码中实现对象和数据库层的映射。
 
The data-model syntax offers many rich ways of representing your models - so far,it;s been solving two years' worth of database-schema problems . Here's quick example,which might be saced in the file mysite/news/models.py:
数据库-模型的语法提供了非常多的方式来表示你的模型,到目前为止,它解决了两年前的数据库模式问题,这里有一个简短的例子,它可能会保存在文件 mysite/news/models.py 里:
2.1.2 Install it
Next , run the Django command-line utility to create the database tables automatically:
接下来,通过命令行来运行的django 自动创建数据库表:
The syncdb command looks at all your available models and creates tables in your database for whichever for whichever tables don't already exist.
同步命令会考虑到你所有有用的model,当数据库中表不存在时会自动创建表。
 
2.1.3 Enjoy the free API (享受免费的API)
With that, you've got a free,and rich,Python API to access your data. The API is created on the fly,no code  generation nessary :
于是,你会的到一个免费,多用的Python接口去访问你的数据,这个API在运行中创建,不需要代码。
 
2.1.4 A dynamic admin interface : it's not just scaffolding - it's the whole house
一个动态的管理后台接口:他不是一个简单的小工具,而是整个功能。
The philosophy here is that your site is edited by a staff , or a client ,or maybe just you - and you don't want to have to deal with creating backend interfaces just to manage content.
这里的哲学网站是一个员工,一个客户,或者就是你编辑,你仅仅希望管理内容,而不是解决后端接口问题。
 
One typical workflow in creating Django apps is to create models and get the admin sites up and running as fast as possible , so your staff(or clients)can start populating data.Then,develop the way data is presented to the public.
创建django的一个模型,然后得到一个管理后台,然后尽可能快的运行,你的员工(或者客户)可以增加数据,开发一种可以数据直接展示出来的工作流。
 
2.1.4 结束。
 
 
 
 
 
 
 
 
 

posted on 2012-07-11 21:20  DON'T PANIC  阅读(385)  评论(0编辑  收藏  举报

导航