在url.py中寫入URL
一定要導入視圖:
from.mysite import hello url(r'^hello/$',hello), #r表示不轉義特殊字符。
2.定義一個views.py 寫入下面的語句
from django.http import HttpResponse def hello(request): return HttpResponse("Hello world")
3.這樣輸入python manage.py runserver 訪問127.0.0.1:8000/hello/ 就會看到helloworld了。