个人工具

“UbuntuHelp:Django”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/Django}} {{Languages|UbuntuHelp:Django}} === Introduction === Django is a high-level Python Web framework that encourages rapid development and cl...)
 
第8行: 第8行:
 
Also see http://www.djangobook.com/
 
Also see http://www.djangobook.com/
 
=== Installation ===
 
=== Installation ===
==== Quick shortcut ====
 
If you would rather not setup the Django framework by hand, then one of the easiest ways to get up and running with Django is the [http://www.turnkeylinux.org/appliances/django  TurnKey Django ] installable live CD appliance, which is based on Ubuntu 8.04.1 (Hardy).
 
 
==== Installing on Apache using mod_python ====
 
==== Installing on Apache using mod_python ====
 
Install Ubuntu-Server
 
Install Ubuntu-Server
第30行: 第28行:
 
sudo /etc/init.d/apache2 reload</nowiki></pre>
 
sudo /etc/init.d/apache2 reload</nowiki></pre>
 
Hit the box with a browser, and you should see "Django examples" and some links.
 
Hit the box with a browser, and you should see "Django examples" and some links.
 +
=== External Links ===
 +
The following are unverified suggestions made by users.
 +
==== Turnkey Linux ====
 +
An Ubuntu-based [[UbuntuHelp: http://www.turnkeylinux.org/appliances/django | Django appliance ]] is one of the easiest ways to get up and running with the Django framework on Ubuntu. It's part of a family of pre-integrated [[UbuntuHelp: http://www.turnkeylinux.org/ | TurnKey Linux ]] [[UbuntuHelp: http://www.turnkeylinux.org/appliances | Software Appliances ]] based on Ubuntu 8.04.2 (Hardy LTS). 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2009年5月18日 (一) 15:29的版本

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

Installing on Apache using mod_python

Install Ubuntu-Server

sudo apt-get install libapache2-mod-python python-django
sudo vim /etc/apache2/sites-available/django-example
<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>
sudo a2dissite default
sudo a2ensite django-example
sudo /etc/init.d/apache2 reload

Hit the box with a browser, and you should see "Django examples" and some links.

External Links

The following are unverified suggestions made by users.

Turnkey Linux

An Ubuntu-based Django appliance is one of the easiest ways to get up and running with the Django framework on Ubuntu. It's part of a family of pre-integrated TurnKey Linux Software Appliances based on Ubuntu 8.04.2 (Hardy LTS).