随笔分类 -  python

python with django framework etc.
摘要:一.重要概念 app: is a Web application that does something. An app usually is composed of a set of models (database tables), views, templates, tests. projec 阅读全文
posted @ 2021-08-24 11:08 Shapley 阅读(47) 评论(0) 推荐(0) 编辑
摘要:一:安装uWSGI 1.1安装uWSGI 在/usr/local目录下新建目录:uwsgi,用于存储uWSGI配置文件及日志。配置文件内如如下: # mysite_uwsgi.ini file [uwsgi] # Django-related settings # the base director 阅读全文
posted @ 2021-08-20 17:33 Shapley 阅读(605) 评论(0) 推荐(0) 编辑
摘要:1.安装python3.8.5,见上一篇随笔。 2.安装报错记录: mysqlclient安装出错: OSError: mysql_config not found 解决办法: yum install mysql-devel gcc gcc-devel python-devel 注意如果报错: Er 阅读全文
posted @ 2021-08-20 17:12 Shapley 阅读(342) 评论(0) 推荐(0) 编辑
摘要:安装PyMySQL:注意:命令中的PyMySQL是区分大小写的,不能写错。 pip install PyMySQL Collecting PyMySQL Downloading PyMySQL-1.0.2-py3-none-any.whl (43 kB) |█████████████████████ 阅读全文
posted @ 2021-08-19 14:09 Shapley 阅读(2203) 评论(0) 推荐(0) 编辑
摘要:报错原因为缺少共享库: yum whatprovides libSM.so.6 查看下libSM版本,然后,运行命令: yum install libSM-1.2.2-2.el7.x86_64 --setopt=protected_multilib=false 或者 sudo yum install 阅读全文
posted @ 2021-08-18 17:27 Shapley 阅读(1130) 评论(0) 推荐(0) 编辑
摘要:给Django项目添加日志,需要在settings.py及views.py页面进行设置。 settings.py页面,添加代码: BASE_LOG_DIR = os.path.join(BASE_DIR, "log") LOGGING = { 'version': 1, # 保留字 'disable 阅读全文
posted @ 2021-08-12 16:41 Shapley 阅读(443) 评论(0) 推荐(0) 编辑
摘要:Django项目在发布时,一般会设置:DEBUG = False,但这时系统不会自动给配置路由,需要我们手工配置,那么配置的方法如何呢?其实很简单,关键有两点: 关键点一: 在项目的urls.py文件中,添加: from django.conf.urls import url, static fro 阅读全文
posted @ 2021-08-12 11:16 Shapley 阅读(157) 评论(0) 推荐(0) 编辑
摘要:Django项目在发布时,一般会设置:DEBUG = False,但这时系统不会自动给配置路由,需要我们手工配置,那么配置的方法如何呢?其实很简单,关键有两点: 关键点一: 在项目的urls.py文件中,添加: from django.conf.urls import url, static fro 阅读全文
posted @ 2021-08-12 11:15 Shapley 阅读(108) 评论(0) 推荐(0) 编辑
摘要:场景描述 有一个对象列表,数据结构如下: [[[[56, 21], [261, 22], [261, 46], [56, 45]], '1、 stackoverflow加速', 0.8046855330467224], [[[55, 76], [674, 76], [674, 100], [55, 阅读全文
posted @ 2021-08-10 10:37 Shapley 阅读(89) 评论(0) 推荐(0) 编辑
摘要:准备开发环境 提前准备好python(本机:3.7.4),pip等组件(略)。 1.下载并安装mycharm 2.下载并安装django框架,操作步骤为:file-->settings-->project(python interpreter),查看右侧是否有django框架,若没有则新增: 新增页 阅读全文
posted @ 2021-07-28 14:39 Shapley 阅读(88) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示