django

chap1   the first web

   create: django-admin.py startproject mysite

startup: python manage.py runserver 8000
 

1. urls.py

from django.conf.urls import url
from django.contrib import admin
from mysite import views

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$',views.first_page)
]
View Code

2.

# -*- coding: utf-8 -*-

from django.http import HttpResponse

def first_page(request):
    return HttpResponse("<p>hello world!</p>")
View Code

3.

 

posted on 2019-01-19 14:51  arcfz  阅读(62)  评论(0编辑  收藏  举报

导航