from django.shortcuts import render
defindex(request):
words='World!'return render(request,'index.html',context={'words':words})# Create your views here.
5.配置urls.py
urls.py源代码
from django.contrib import admin
from django.urls import path
from index.views import index
urlpatterns =[
path('admin/', admin.site.urls),
path('',index)]