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")

 

posted @ 2021-09-23 12:59  呆呆蒙蒙  阅读(26)  评论(0编辑  收藏  举报