1. 安装python:
sudo apt-get install python
tar xzvf Django-1.2.5.tar.gz cd Django-1.2.5 sudo python setup.py install
cd Development //进入你自己想要创建项目的目录 django-admin.py startproject DjangoTest
cd DjangoTest python manage.py runserver
Validating models... 0 errors found Django version 1.2.5, using settings 'DjangoTest1.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C.
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, Python web!")
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^$', 'DjangoTest.Hello.index'),
)