**我创建了这个,但是当我尝试运行服务器时,它只显示 django 网站。我已将其关闭,因为防火墙也不是问题。**
from django.contrib import admin
from django.urls import path
from django.http import HttpResponse
def home(request):
return HttpResponse('home')
def contact(request):
return HttpResponse('contact')
urlpatterns = [
path('admin/', admin.site.urls),
path('', home),
path('about/', contact),
]
**I also added it to apps**
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'accounts',
]
慕容森
相关分类