中文版django官方教程part2(1)

发布时间:2011-08-08 21:00:49   来源:文档文库   
字号:
Writing your first Django app, part 2编写你的第一个Django程序,第二部分This tutorial begins where Tutorial 1left off. We’re continuing the Web-poll application and will focus on Django’s automatically-generated admin site.本文接续第一部分。我们会继续开发网页投票程序,并深入研究Django自动生成后台的功能。PhilosophyGenerating admin sites for your staff or clients to add, change and delete content is tedious work thatdoesn’t require much creativity. For that reason, Django entirely automates creation of admin interfaces for models.Django was written in a newsroom environment, with a very clear separation between ―content publishers‖and the ―public‖ site. Site managers use the system to add news stories, events, sports scores, etc., and that content is displayed on the public site. Django solves the problem of creating a unified interface for siteadministrators to edit content.The admin isn’t necessarily intended to be used by site visitors; it’s for site managers.哲理为你的员工或客户创建后台来管理内容是一件不需要什么创意的乏味工作。因为这个原因,Django为模型对象有一套完整的自动创建管理界面的机制。Django是在一个新闻编辑部里诞生的,在这个环境下在―内容编辑‖和―公众网站‖之间有很明显的分界线。网站管理员使用这个系统来增加新闻内容、时间、体育赛事报道等等,而这些内容会在公众网站上展示出来。Django为网站管理员提供了一个统一的管理界面。管理工具不是让网站访问者来使用的;它是为了网站管理员而准备的。Activate the admin site启用管理后台The Django admin site is not activated by default – it’s an opt-in thing. To activate the admin site for your installation, do these three things:∙Add "django.contrib.admin" to your INSTALLED_APPS setting.∙Run python manage.py syncdb. Since you have added a new application to INSTALLED_APPS, the database tables need to be updated.

本文来源:https://www.2haoxitong.net/k/doc/275a9e126c175f0e7cd137df.html

《中文版django官方教程part2(1).doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式