摘要:
1、配置文件 2、使用配置文件 3、写入配置文件 阅读全文
摘要:
from django.contrib import admin from .models import Article,Category from datetime import datetime # Register your models here. @admin.register(Article) class ArticleAdmind(admin.ModelAdmin): li... 阅读全文
摘要:
django实现文件(图片)上传之后自动修改名称以及页面上传图片时的各种提醒: 1、先在你项目中添加一个文件夹如:system 在文件夹下添加__init__.py 和storage.py文件,并在storage.py中添加如下代码: 2、在models.py文件中添加如下代码: 阅读全文
摘要:
1、使用ImgFiled class ImageField(upload_to=None, height_field=None, width_field=None, max_length=100, **options)[source]¶ 返回资源 必须在setting.py 中设置MEDIA set 阅读全文
摘要:
2、url路径 可以在每一个app应用下创建urls.py文件 在模板使用 阅读全文
摘要:
错误一:No module named 'MySQLdb' 原因:python3连接MySQL不能再使用mysqldb,取而代之的是pymysql。 解决方法:在python的MySQL包中,即路径:C:\Users\adong\AppData\Local\Programs\Python\Pytho 阅读全文
摘要:
1、安装mysql库 pip install pymysql 2、使用 阅读全文
摘要:
1、导出 pip freeze > packegas.txt 2、在其他环境安装 pip install -r packages.txt 阅读全文
摘要:
升级的mysql5.7修改完root账户密码后仍然无法登陆,查阅资料可能和user表的plugin 字段为空有关。 1、首先将my.ini中加入在[mysqld]节点上加skip-grant-tables 主要作用是:跳过表中的验证,可以无密码登陆。 2、登录之后查询plugin字段值: mysql 阅读全文