当前位置: 首页 > news >正文

推荐做ppt照片的网站seo怎么去优化

推荐做ppt照片的网站,seo怎么去优化,竹林wordpress主题,wordpress难吗目录 1、安装Django Debug Toolbar Django的一个优势就是有丰富的第三方包生态系统。这些由社区开发的包,可以用来快速扩展应用程序的功能集 1、安装Django Debug Toolbar Django Debug Toolbar位于名列前三的第三方包之一 这是一个用于调试Debug Web应用程序的有…

目录

  • 1、安装Django Debug Toolbar

Django的一个优势就是有丰富的第三方包生态系统。这些由社区开发的包,可以用来快速扩展应用程序的功能集

1、安装Django Debug Toolbar

Django Debug Toolbar位于名列前三的第三方包之一
这是一个用于调试Debug Web应用程序的有用工具。该工具帮助我们了解应用的运行方式并发现问题。它通过提供面板来提供有关当前请求和响应的调试信息
在已激活的虚拟环境中运行以下命令来安装包

py -m pip install django-debug-toolbar

在这里插入图片描述
与django集成的第三方包需要一些安装后的设置,以将它们与我们的项目整合在一起。我们需要将包的Django应用程序添加到你的INSTALLED_APPS设置中。有些包需要其他更改,比如添加到我们的URL配置中。
链接: 安装指南
在polls/settings中添加
在这里插入图片描述
在项目URLconf中添加:
在这里插入图片描述
添加中间件polls/settings
在这里插入图片描述
polls/settings

INTERNAL_IPS=["127.0.0.1",
]

如果要在项目中运行测试,则不应激活工具栏。你 可以通过添加另一个设置来执行此操作

polls/settings

TESTING="test"in sys.argv
if not TESTING:INSTALLED_APPS=[*INSTALLED_APPS,#* 符号用于将一个列表或元组中的所有元素解包,并将其插入到另一个列表或元组中"debug_toolbar",]MIDDLEWARE=["debug_toolbar.middleware.DebugToolbarMiddleware",*MIDDLEWARE,]

URLconf:

from django.conf import  settings
if not settings.TESTING:urlpatterns=[*urlpatterns,]+debug_toolbar_urls()

使用 * 将列表或元组中的元素作为单独的参数传递给函数:
def add(a, b, c): return a + b + c numbers = [1, 2, 3] result = add(*numbers) # 相当于 add(1, 2, 3) print(result) # 输出 6

使用 * 将一个列表或元组中的所有元素插入到另一个列表或元组中:
list1 = [1, 2, 3] list2 = [4, 5, 6] combined = [*list1, *list2] print(combined) # 输出 [1, 2, 3, 4, 5, 6]

总之最终的settings

"""
Django settings for vote project.Generated by 'django-admin startproject' using Django 5.0.6.For more information on this file, see
https://docs.djangoproject.com/en/5.0/topics/settings/For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.0/ref/settings/
"""
import sys
from pathlib import Path# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "django-insecure-g%c$9$3_-z8znkcj+qdf=oki+0m!y$7d8anr#i)%bcfq(#iq#l"# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = TrueALLOWED_HOSTS = []
INTERNAL_IPS=["127.0.0.1",
]# Application definitionINSTALLED_APPS = [# "debug_toolbar","polls.apps.PollsConfig","django.contrib.admin",#管理员站点"django.contrib.auth",#认证授权系统"django.contrib.contenttypes",#内容类型框架"django.contrib.sessions",#会话框架"django.contrib.messages",#消息框架"django.contrib.staticfiles",#管理静态文件的框架
]MIDDLEWARE = [# "debug_toobar.middleware.DebugToolbarMiddleware","django.middleware.security.SecurityMiddleware","django.contrib.sessions.middleware.SessionMiddleware","django.middleware.common.CommonMiddleware","django.middleware.csrf.CsrfViewMiddleware","django.contrib.auth.middleware.AuthenticationMiddleware","django.contrib.messages.middleware.MessageMiddleware","django.middleware.clickjacking.XFrameOptionsMiddleware",
]
DEBUG_TOOLBAR_PANELS=["debug_toolbar.panels.versions.VersionsPanel","debug_toolbar.panels.timer.TimerPanel","debug_toolbar.panels.settings.SettingsPanel","debug_toolbar.panels.headers.HeadersPanel","debug_toolbar.panels.request.RequestPanel","debug_toolbar.panels.sql.SQLPanel","debug_toolbar.panels.staticfiles.StaticFilesPanel","debug_toolbar.panels.templates.TemplatesPanel","debug_toolbar.panels.cache.CachePanel","debug_toolbar.panels.signals.SignalsPanel","debug_toolbar.panels.logging.LoggingPanel","debug_toolbar.panels.redirects.RedirectsPanel",]
ROOT_URLCONF = "vote.urls"TEMPLATES = [{"BACKEND": "django.template.backends.django.DjangoTemplates","DIRS": [BASE_DIR/"templates"],#在Django载入模板时使用,是一个待搜索路径"APP_DIRS": True,"OPTIONS": {"context_processors": ["django.template.context_processors.debug","django.template.context_processors.request","django.contrib.auth.context_processors.auth","django.contrib.messages.context_processors.messages",],},},
]WSGI_APPLICATION = "vote.wsgi.application"
## Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databasesDATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3","NAME": BASE_DIR / "db.sqlite3",}
}# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validatorsAUTH_PASSWORD_VALIDATORS = [{"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",},{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",},{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",},{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",},
]# Internationalization
# https://docs.djangoproject.com/en/5.0/topics/i18n/LANGUAGE_CODE = "zh-hans"TIME_ZONE = "Asia/Shanghai"USE_I18N = True
USE_L10N = True
USE_TZ = TrueLANGUAGES = [('en', 'English'),('zh-hans', '简体中文'),
]# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/STATIC_URL = "/static/"
TESTING="test" in sys.argv
if not TESTING:INSTALLED_APPS +=[# *INSTALLED_APPS,#* 符号用于将一个列表或元组中的所有元素解包,并将其插入到另一个列表或元组中"debug_toolbar",]MIDDLEWARE=["debug_toolbar.middleware.DebugToolbarMiddleware",# *MIDDLEWARE,]+MIDDLEWARE
# Default primary key field type
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-fieldDEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

vote.urls

from django.contrib import admin
from django.urls import include,path
import debug_toolbar
from django.conf import  settings
urlpatterns = [path("polls/",include("polls.urls")),path("admin/", admin.site.urls),
]if not settings.TESTING:urlpatterns +=[path('__debug__/',include(debug_toolbar.urls)),]

页面右方会显示面板
在这里插入图片描述
在这里插入图片描述

其他内容可参考
链接: 第8节 添加第三方包

http://www.hkea.cn/news/502473/

相关文章:

  • ps做网站的分辨率多少钱苹果cms永久免费建站程序
  • 网站推广积分常用于网站推广的营销手段是
  • wordpress时间云储存沈阳网站制作优化推广
  • h5响应式网站建设竞价托管哪家效果好
  • 企业解决方案参考网站品牌软文营销案例
  • 做淘客要有好的网站上海百度seo
  • 网站建设 seojsc宁德seo推广
  • 建立网站的作用信息流优化师工作总结
  • 如何建设物流网站近期时事新闻
  • 网站开发大赛发言稿网址搜索
  • 论坛类型的网站怎么做拉新推广平台有哪些
  • pc官方网站视频专用客户端app
  • 成都哪家做网站建设比较好搜索关键词排名查询
  • 无锡网站优化推广广州网站推广运营
  • 电子商务网站开发的步骤短视频seo排名系统
  • 如何用模板做网站视频河北电子商务seo
  • 动态网站代码设计做小程序的公司
  • 网站建设软件开发的新闻北京关键词优化报价
  • 在上海做兼职在哪个网站好百度售后电话人工服务
  • 深圳网站开发招聘谁能给我个网址
  • 长沙做个网站多少钱怎样免费给自己的公司做网站
  • wordpress to微博优化营商环境条例
  • 做外贸通常用哪些网站seo网站监测
  • 电子商务网站建设解决方案必应搜索引擎
  • 企业网页制作与网站设计南京seo优化培训
  • sqlite开发网站想做网络推广的公司
  • 网页设计作业在线网站首页seo教程seo优化
  • 做个网站多钱域名备案查询系统
  • 饰品网站模板官网seo关键词排名系统
  • 文学网站做编辑百度笔记排名优化