摘要:
from django.shortcuts import render, HttpResponsefrom Day72bbs.settings import MEDIA_ROOTfrom docxtpl import DocxTemplateimport osimport xlrd MEDIA_RO 阅读全文
随笔档案-2021年02月
python 批量打印word文档
2021-02-27 17:17 by ttym88m, 371 阅读, 收藏,
摘要:
1.pip install pypiwin32 安装模块 2.创建类:printers.py import tempfileimport win32apiimport win32printdef printer_loading(filename): open(filename, "r") win32 阅读全文
python 批量打印word文档
2021-02-27 15:57 by ttym88m, 734 阅读, 收藏,
摘要:
1.在settings.py 文件中。加入如下语句 MEDIA_URL='/doctemplates/' #模板的路径名称MEDIA_ROOT = os.path.join(BASE_DIR, 'doctemplates')#模板的路径2.在工程下面建立 doctemplates 文件夹。用于存放模 阅读全文
Python Django 使用数据库中的视图
2021-02-27 15:38 by ttym88m, 271 阅读, 收藏,
摘要:
1.在AppDatabaseViews项目中,创建 mysqlviews.py模块。模块中的内容如下:from AppDatabaseViews.models import * # #AppDatabaseViews 是项目工程 class viewsbookandpublish(models.Mo 阅读全文
Django配置文件static文件夹与 csrf
2021-02-24 08:39 by ttym88m, 68 阅读, 收藏,
摘要:
1.静态文件控制 ,在static中使用 setting.py的配置 STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static') ]2.网页中的使用情况 static 文件夹下面要配置bootstrap 阅读全文
清除chrome的缓存
2021-02-24 08:20 by ttym88m, 276 阅读, 收藏,
摘要:
1。在网页的空白处点击 右键 ->检查 -> 设置齿轮 按钮-> network ->Disable cache 勾选。勾选后就可以去除缓存了。 阅读全文
settings.py 中Mysql中的设置
2021-02-20 11:08 by ttym88m, 124 阅读, 收藏,
摘要:
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 'NAME': 'databaseName', 'USER': 'root 阅读全文
settings.py 中 static路径的设置
2021-02-20 11:07 by ttym88m, 94 阅读, 收藏,
摘要:
STATIC_URL = '/static/'STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static')] 阅读全文
Python Test 中 设置
2021-02-20 11:05 by ttym88m, 41 阅读, 收藏,
摘要:
import osimport sysif __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Day66libSys.settings") import django django.setup() fro 阅读全文
Django ajax 笔记
2021-02-19 20:27 by ttym88m, 56 阅读, 收藏,
摘要:
1.后端数据编码格式的不同 ''' 1. 3种编码格式 urlencoded formdata json 2.默认的数据格式编码urlencoded 2.1 数据格式编码urlencoded 数据格式 username=json&passowrd=123 django后端针对urlencode编码格 阅读全文
浙公网安备 33010602011771号