Django-hello world

1、創建項目

2、創建應用

3、運行python manage.py runserver運行服務器

4、創建視圖函數view.py

from django.http import HttpResponse

def home(request):
    return HttpResponse("hello world")
   
5、視圖函數對應的URL:

urlpatterns = [
    url(r'^$','cloudmanagement.view.home',name='home'),  
6、運行localhost:8000

顯示 hello world
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章