1、直接返回
return HttpResponse('something write here')
2、强制跳转
return redirect('http://www.baidu.com')
3、返回相应的模板页面
return render(request, 'something.html', {})
1、直接返回
return HttpResponse('something write here')
2、强制跳转
return redirect('http://www.baidu.com')
3、返回相应的模板页面
return render(request, 'something.html', {})
python -m venv ll_env
ll_env\scripte\activate
1、默认模板位置在每个app下的templates文件夹,
可以在在项目设置文件setting.py中 进行修改 在 TEMPLATES -- DIRS 修改
1、默认urls在项目文件夹下的urls.py
2、可以添加额外的urls.py文件,如下即将app1下的urls添加:
urlpatterns = [
...
path('',include('app1.urls')),
]