python manage.py startapp demo
from django.shortcuts import render# Create your views here.from django.http importHttpResponsedef index(request):returnHttpResponse("Hello, world. You‘re at the demo index.")from django.conf.urls import urlfrom.import viewsurlpatterns =[ url(r‘^$‘, views.index, name=‘index‘),]from django.conf.urls import include, urlfrom django.contrib import adminurlpatterns =[ url(r‘^demo/‘, include(‘demo.urls‘)), url(r‘^admin/‘, admin.site.urls),]
url(r‘^$‘, views.index, name=‘index‘),原文:http://www.cnblogs.com/leejy/p/6745181.html