个人工具
119.28.94.63
该IP地址的讨论
登录
查看“UbuntuHelp:Django”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:Django”的源代码
来自Ubuntu中文
←
UbuntuHelp:Django
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/Django}} {{Languages|UbuntuHelp:Django}} === Introduction === Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Python's equivalent to the famous Ruby on rails, Django lets you build high-performing, elegant Web applications quickly. Django focuses on automating as much as possible and adhering to the "Don't Repeat Yourself" (DRY) principle. It can be found at http://www.djangoproject.com/. === How it works === In Django, first you define your database models, which generate SQL for the database and allow Django to know about the data. This is essential for the DRY (don't repeat yourself) concept. Next, the views are defined, this is where any business logic, interactions with the database and the like go. Then, the URLs are defined as regular expression the map to views. Finally, templates are written, which are html (or anything composed of text) with data and simple data control sprinkled throughout. Also see http://www.djangobook.com/ === Installation === ==== Alternative to manual installation ==== Some users may prefer to skip manual installation by using the unofficial pre-integrated [http://www.turnkeylinux.org/django TurnKey Django Appliance] based on Ubuntu LTS. ==== Installing on Apache using mod_python ==== Install Ubuntu-Server <pre><nowiki> sudo apt-get install libapache2-mod-python python-django sudo vim /etc/apache2/sites-available/django-example </nowiki></pre> <pre><nowiki> <Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython PythonDebug On PythonPath "['/usr/share/doc/python-django'] + sys.path" SetEnv DJANGO_SETTINGS_MODULE examples.settings </Location> </nowiki></pre> <pre><nowiki> sudo a2dissite default sudo a2ensite django-example sudo /etc/init.d/apache2 reload</nowiki></pre> Hit the box with a browser, and you should see "Django examples" and some links. [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:Django
。