其他分享
首页 > 其他分享> > django第一个项目helloworld

django第一个项目helloworld

作者:互联网

djangoproject-urls

from django.contrib import admin
from django.urls import path
from app01.views import *
from django.conf.urls import include

urlpatterns = [
    # path('admin/', admin.site.urls),
    path('',include('app01.urls'))
]

app01-urls

from django.urls import path
from . import views
urlpatterns = [
    path('',views.index)
]

app01-views

from django.http import HttpResponse

def index(request):
    return HttpResponse("hello world")

 

标签:第一个,views,helloworld,django,app01,urls,path,import
来源: https://www.cnblogs.com/ljf520hj/p/15323732.html