![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
django
文章平均质量分 53
django
lin_yulin
这个作者很懒,什么都没留下…
展开
-
django-runserver报错:TypeError: argument of type ‘WindowsPath‘ is not iterable
原因settings.py文件里DATABASES设置里NAME的设置代码:DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', }}解决DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3'..原创 2021-04-10 00:10:36 · 204 阅读 · 0 评论 -
django-静态文件
添加静态文件夹新建 static 文件夹在配置文件 settings.py 中设置BASE_DIR指路径‘static' 指新建的文件夹名字STATIC_URL = '/static/' # 在此后添加STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'), # 逗号“,”不能缺,否则会报错)html中调用/static/:指代 G:/0_File/Python/django/mysite/st.原创 2021-04-09 23:59:51 · 118 阅读 · 0 评论 -
django-模板
添加模板新建 templates 文件夹在配置文件 settings.py 中设置TEMPLATES 中的'DIRS': [os.path.join(BASE_DIR, 'templates')]BASE_DIR指路径import osTEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(B.原创 2021-04-09 23:34:36 · 73 阅读 · 0 评论 -
django runserver报错cannot import name ‘RemovedInDjango30Warning‘ from ‘django.utils.deprecation‘
报错内容:G:\0_File\Python\django\mysite>python manage.py runserverWatching for file changes with StatReloaderPerforming system checks...Traceback (most recent call last): File "D:\python3.8\lib\site-packages\django\template\utils.py", line 66, in...原创 2021-04-09 22:56:30 · 2221 阅读 · 0 评论 -
(2)Django基础内容
课程:Python全栈(老男孩4期)Django框架入门到应用 https://www.bilibili.com/video/BV1mW411G7g6?p=5&t=544Django项目配置pip3 install django #安装django# 创建Django程序django-admin startproject mysite# 进入程序目录cd mysite# 启动socket服务端,等待用户发送请求python manage.py runserver...原创 2021-04-07 23:06:52 · 140 阅读 · 0 评论 -
(1)Web框架本质
课程:Python全栈(老男孩4期)Django框架入门到应用 https://www.bilibili.com/video/BV1mW411G7g6?p=5&t=544目录web系统概念web框架本质静态网站动态网站手动进行替换的模版使用jinjia2模板引擎进行替换自定义Web框架框架种类web系统概念1. Http,无状态,短连接2. 浏览器(socket客户端)、网站(socket服务端)web框架本质import socket...原创 2021-04-07 22:54:22 · 152 阅读 · 1 评论