标签:
架构图:
setting.py:
INSTALLED_APPS = [ ... ‘bootstrap‘, ]
myapp -> myapp -> urls.py
from django.conf.urls import url, include from django.contrib import admin urlpatterns = [ url(r‘^admin/‘, admin.site.urls), url(r‘^bootstrap/‘, include(‘bootstrap.urls‘)), ]
myapp -> bootstrap -> urls.py
from django.conf.urls import url from . import views urlpatterns = [ url(r‘^$‘, views.index, name=‘index‘), url(r‘^helloworld/‘, views.helloworld, name=‘helloworld‘), ]
myapp -> bootstrap -> views.py
from django.shortcuts import render # Create your views here. from django.http import HttpResponse def helloworld(request): return HttpResponse("Hello world") def index(request): return HttpResponse("Hello, world. You‘re at the polls index.")
截图一: index
截图二: helloworld
标签:
原文地址:http://www.cnblogs.com/timliucn/p/5898310.html