- 博客(248)
- 资源 (21)
- 收藏
- 关注
原创 Ubuntu环境下使用nginx实现强制下载静态资源
至此配置结束,可访问ip/your path/文件名 浏览器强制下载静态资源。在http配置中添加(/your path/为需要下载的文件路径)重启nginx服务使其生效。
2023-12-05 10:06:04 404
原创 解决Ubuntu报错ModuleNotFoundError: No module named ‘pip‘
解决Ubuntu报错ModuleNotFoundError: No module named 'pip'
2023-05-21 12:04:04 650
原创 解决Ubuntu报错ModuleNotFoundError: No module named ‘pip‘
解决Ubuntu报错ModuleNotFoundError: No module named 'pip'
2023-05-21 11:59:30 528
原创 解决pip install Please make sure the libxml2 and libxslt development packages are installed
解决pip install Please make sure the libxml2 and libxslt development packages are installed
2023-05-21 11:09:42 2732 2
原创 键盘控制程序
键盘控制程序,Python tkinter实现# -*- coding: utf-8 -*-"""Created on Tue Feb 26 12:29:57 2019@author: 车路历程"""from tkinter import * def Advance(event): print("前进") def Retreat(event): print("后退") def Left(event): print("向左") def Right(even
2022-03-12 16:43:55 620
原创 Python-docx设置纸张方向为横向
此篇博客将从两个方面讲清楚如何使用Python-docx库将docx文档设置为横向第一种,设置当前页面方向为横线from docx import Documentfrom docx.enum.section import WD_ORIENT#这里能够获取到当前的章节,也就是第一个章节section = document.sections[0]#需要同时设置width,height才能成功new_width, new_height = section.page_height, section.p
2022-01-23 22:26:16 2852
原创 Django xadmin一次性选择多图上传并展示
Django xadmin实现一次性选择多张图片并存储的一个方法, 以及详情页面多图展示代码结构图直接上源码models.py设置如下class picture(models.Model): imgs = UploaderImageField(max_length=500, verbose_name='活动图片', null=True, blank=True, upload_to='image/') #文件#单图的设置class Img(models.Model):
2022-01-23 12:23:54 1767
原创 解决Django xadmin 图片上传后在后台无法显示和下载,出现Page not found (404)错误
问题详情:使用xadmin作为管理后台时,图片上传后在后台无法显示和下载,出现Page not found (404)错误原因:media路由没有正确配置解决方法settings.py中的设置:# 设置上传文件的路径MEDIA_URL = '/media/'MEDIA_ROOT = os.path.join(BASE_DIR, 'media') #media即为图片上传的根路径urls.py中的设置from django.urls import path,re_pathfrom d
2022-01-23 09:42:19 1579
原创 word2010中在当前页开始计算页码
核心步骤:分节分节后如下步骤:第一步:在需要成为第一页前一页末尾,添加分节符(若添加了新的一页,则删了新添加的这一页即可)第二步:点击第一页的页脚,点击最上方的取消链接到前一页页眉第三步:设置页码格式,插入页码,效果如图:...
2021-06-01 09:48:42 693
原创 django报错File “manage) from exc ^ SyntaxError: invalid syntax
Django报错: File "manage.py", line 14 ) from exc ^SyntaxError: invalid syntax出现此问题的原因是没有使用虚拟环境运行此项目。解决的方法:进入虚拟环境后重新运行此项目。s
2021-05-29 21:11:09 968
原创 layui页面返回顶部效果
<!--引入layui--><link rel="stylesheet" type="text/css" href="'css/layui/css/layui.css"/> <script src="js/layui.js" type="text/javascript"></script><script type="text/javascript"> // 回到顶部 layui.use(['util', 'laydate', '
2021-05-23 08:34:06 1583 1
原创 ubuntu将Django项目挂起在后台命令
使用如下命令,即可将Django项目在后台挂起,免杀死nohup python manage.py runserver 0.0.0.0:8000 &关闭终端后项目仍然可以继续运行
2021-05-17 19:35:23 398
原创 成功解决django迁移过程中出现的 return int(value) ValueError: invalid literal for int() with base 10: ‘‘错误
在django迁移过程中可能出现如下错误 Applying users.0006_auto_20210516_2004...Traceback (most recent call last): File "manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/home/xiaobai/.virtualenvs/vtbd1/lib/python3.6/site-packages/dj
2021-05-16 21:18:01 593
原创 解决echarts词云图只显示标题不显示字符云的问题
在使用echarts-wordcloud时,出现了只显示标题不显示字符云的问题,查看代码后发现,在导入echarts-wordcloud.js后才导入echarts.js解决的方法:先导入echarts.js,后导入入echarts-wordcloud.js,即可解决这个问题...
2021-05-14 10:12:59 1782
原创 Django2实现word文件的下载功能
Django实现文件的下载的三种方式https://www.jb51.net/article/137790.htmDjango2实现word文件的下载功能(docx文件),可以文件具有中文字符的情况前端代码{% load staticfiles %}<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title>
2021-05-12 10:07:53 422 1
原创 使用echarts图做Drink Flavors图
使用echarts图做Drink Flavors图,案例来自echarts官网实现效果图:<!DOCTYPE html><html style="height: 100%"> <head> <meta charset="utf-8"> </head> <body style="height: 100%; margin: 0"> <div id="container"
2021-05-11 17:42:21 308
原创 使用Pyecharts做词云可视化展示
使用Pyecharts可做词云的展示,在制作完词云图生成HTML后可以编辑此文件,做出更多的页面。使用Pyecharts做词云展示的学习网站:https://www.cnblogs.com/zhuwjwh/p/12496852.html生成数据后可以查看HTML代码,并且编辑此页面echarts做词云可视化:https://blog.csdn.net/qq_42092076/article/details/115767833?spm=1001.2014.3001.5501...
2021-05-10 19:40:12 971
原创 AttributeError: The vocab attribute was removed from KeyedVector in Gensim 4.0.0
出现如下问题,解决方法:更换gensim的版本pip install gensim ==3.0.0
2021-05-10 16:31:25 6741 4
原创 matplotlib中文字体的设置
如果在使用matplotlib画图时出现白色框框时,可能是因为matplotlib的中文字体设置的问题,在ubuntu中设置matplotlib字体的方式如下:#1.首先在Python3解释器中查看当前环境下matplotlib字体所在的路径import matplotlib print(matplotlib.matplotlib_fname())如图所示:2.下载SimHei可从windows中找到中文字体的目录,并将此中文字体放到matplotlib字体目录下windows7的中
2021-05-10 16:28:42 1046
原创 django模板系统的使用
Django模板系统学习网站https://www.runoob.com/django/django-template.html
2021-05-07 09:46:48 74
原创 电脑可以聊微信但是无法上网页的解决方法
电脑可以聊微信但是无法上网页,ping不通百度的IP地址,一般是电脑的DNS出现错误,解决方案如下打开360安全卫士,点击功能大全中的断网急救箱,进行扫描,之后进行修复。问题即可解决。...
2021-05-06 10:53:35 21507 1
原创 成功解决Django运行中出现的without providing an app_name is not supported.错误
Django运行中出现了如下错误:django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_
2021-05-04 16:08:42 156
原创 正则表达式学习与验证网站
学习网站:https://www.cnblogs.com/sun-10387834/p/10352734.html视频学习:https://www.bilibili.com/video/BV19t4y1y7qP?from=search&seid=5438988665635839464网站验证:编程胶囊https://codejiaonang.com/#/course/regex_chapter1/0/1网站验证:https://regexr.com/在线练习正则表达式网站链接:ht
2021-04-24 15:00:58 287
原创 Django前端页面显示时间年月日,不显示时分秒
Django前端页面显示时间年月日,不显示时分秒的方法:格式:2021-04-21{{ time|date:'Y-m-d' }}
2021-04-21 17:10:00 1527
原创 Django实现登录系统后才能进入某些页面的两种方法
Django实现不登录的情况下不能进入某些页面的功能# views.pyfrom django.contrib.auth.decorators import login_required# 在类之前需要添加以下两行代码from django.utils.decorators import method_decorator@method_decorator(login_required,name='dispatch')class LoginView(View): def get(self,
2021-04-20 17:22:20 2517
原创 成功解决TypeError at /usercenter/ as_view() takes 1 positional argument but 2 were given
django报错TypeError at /usercenter/ as_view() takes 1 positional argument but 2 were given报错前url的写法是这样的path("usercenter/",UserCenterView.as_view,name="usercenter"),修改url的写法,解决此问题path("usercenter/",UserCenterView.as_view(),name="usercenter"),...
2021-04-20 14:21:14 2587 1
原创 Django中的queryset
queryset的链式调用posts = Post.objects.filter(status=1).filter(category_id=2).filter(title__icontains="xxx")
2021-04-19 21:19:27 61
原创 解决PackageNotFoundError的错误
使用Python-docx库时import os from docx import Documentfilnames = os .listdir('./')docx_files = [f for f in filnames if f.split('.')[-1] == "docx"]print(docx_files)docxs =[]for docx_file in docx_files: doc = Document(docx_file) for x in doc.parag
2021-04-17 16:50:31 4852 1
原创 使用echarts做词云图
使用echarts做词云图,可以将词云图插入到HTML页面中,不像pyecharts只能生成一个独立的HTML页面,更不像wordcloud生成一张图片。使用echarts可以实现词云(文字云)网上的一个链接:http://www.javashuo.com/article/p-mvbjntzf-bo.html实现的效果图echarts.js echarts-wordcloud.min.js下载链接:https://download.csdn.net/download/qq_42092076/
2021-04-16 17:21:40 36686 1
原创 CSS使用jquery实现点击后选择的效果
<!--引入juery--><script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script><!--CSS样式--><style>.option .optionDefault{ color: #fff; background-color: rgba(255,0,0,.8);}</style><div class="opti
2021-04-16 09:08:05 216
原创 ajax的初步学习
#引入juqery<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.12.4/jquery.js"></script><input id= "title" type="text" name = "title"><!--搜索数据的ajax请求,使用的是GET请求--><script> function AjaxSend() { $.ajax({
2021-04-16 08:53:01 80
图书信息管理系统c语言
2018-07-31
工资管理系统c语言
2018-07-31
飞机订票系统C语言
2018-07-31
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人