
Python填坑指南
Pyhon编程时遇到的一些问题说明以及解决方法
小龙狗
廣闊天地大有作為
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
SQLite 3.9.0 or later is required (found 3.7.17)
问题描述Django 项目中出现问题如下。Django-django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17)问题解决实际就是需要安装一个高版本 Sqlite 的问题,这里记录一下。1. 下载源码包如下,也可以到官网上找合适的版本 https://www.sqlite.org/index.html 。wget https://www.sqlite.org/202原创 2022-02-20 01:01:08 · 4769 阅读 · 0 评论 -
Server returns invalid timezone. Need to set ‘serverTimezone‘ property
都是备注:GMT(Greenwich Mean Time):格林威治标准时间UTC:世界标准时间CST(China Standard Time):中国标准时间GMT + 8 = UTC + 8 = CST原创 2021-03-06 18:21:19 · 8663 阅读 · 0 评论 -
ModuleNotFoundError: No module named ‘psycopg2‘问题及解决
报错如下(venv) D:\geodj\geodjango>python manage.py makemigrationsTraceback (most recent call last): File "D:\geodj\venv\lib\site-packages\django\db\backends\postgresql\base.py", line 25, in <module> import psycopg2 as DatabaseModuleNotFoundEr原创 2020-07-30 23:00:24 · 23781 阅读 · 2 评论 -
Migration admin.0001_initial is applied before its dependency xxx.0001_initial on database ‘default‘
问题定位本人遇到该问题是在 Django 框架下开发,自定义了一个用户表想取代框架自动生成的用户表,执行到 migrate 命令同步数据库时出现。错误详情如下E:\SweetYaya\MyProj01> python manage.py migrateTraceback (most recent call last): File "manage.py", line 22, in <module> main() File "manage.py", line 18, in原创 2021-06-08 21:32:07 · 4697 阅读 · 2 评论 -
DjangoRestFramework-simplejwt中‘str‘ object has no attribute ‘decode‘问题解决
问题描述Python v3.6.6Django v3.2.4djangorestframework v3.12.4djangorestframework-simplejwt v4.4.0运行 runserver 命令后测试接口时后台打印错误如下Traceback (most recent call last): File "D:\Program Files\Python36\lib\site-packages\django\core\handlers\exception.py", lin原创 2021-06-10 08:40:33 · 7904 阅读 · 2 评论 -
django.db.utils.OperationalError: no such table: django_admin_log
问题定位使用 Python Shell 删除自定义的用户表内数据from MyApp import modelsdU = models.SysUsers.objects.all()dU.delete()报错如下django.db.utils.OperationalError: no such table: django_admin_log解决办法直接 migrate 可能不行,要加参数,如下python manage.py makemigrationspython manage.原创 2021-06-20 00:46:03 · 3075 阅读 · 1 评论 -
AttributeError: type object ‘SysUsers‘ has no attribute ‘USERNAME_FIELD‘
错误描述E:\SweetYaya\MyProj03>python manage.py makemigrationsTraceback (most recent call last): File "manage.py", line 22, in <module> main() File "manage.py", line 18, in main execute_from_command_line(sys.argv) File "D:\Program File原创 2021-06-20 00:53:14 · 3172 阅读 · 0 评论 -
ValueError: The field admin.LogEntry.user was declared with a lazy reference to ‘MyApp.sysusers‘
问题描述E:\SweetYaya\MyProj03>python manage.py migrateOperations to perform: Apply all migrations: MyApp, admin, auth, contenttypes, sessionsTraceback (most recent call last): File "manage.py", line 22, in <module> main() File "manage.py原创 2021-06-20 00:58:16 · 3286 阅读 · 0 评论 -
AttributeError: ‘Manager‘ object has no attribute ‘get_by_natural_key‘
问题描述E:\SweetYaya\MyProj03>python manage.py createsuperuserIdentifier: 12Traceback (most recent call last): File "manage.py", line 22, in <module> main() File "manage.py", line 18, in main execute_from_command_line(sys.argv) File原创 2021-06-20 01:03:23 · 5133 阅读 · 0 评论