随笔分类 -  Django问题

摘要:摘要 Django 中的中间件(middleware),是一个镶嵌到Django的request/response处理机制中的一个hooks框架,是一个修改django全局输入输出的一个底层插件系统。让我们可以自定义想要的一些功能来处理用户的请求。 在Django中,中间件其实就是一个类,在类中包含 阅读全文
posted @ 2020-09-21 21:40 sewen 阅读(650) 评论(0) 推荐(1)
摘要:问题: (meiduo) D:\python_learn\meiduo_project\meiduo_mall>python manage.py makemigrations [<RegexURLPattern admins-list ^permission/admins/$>, <RegexURL 阅读全文
posted @ 2020-08-16 20:51 sewen 阅读(2289) 评论(0) 推荐(0)
摘要:celery运行时报错, 报错如下: Traceback (most recent call last): File "d:\python_learn\meiduo_project\env\lib\site-packages\eventlet\support\greendns.py", line 4 阅读全文
posted @ 2020-08-16 15:21 sewen 阅读(1468) 评论(1) 推荐(0)
摘要:redis升级到3.0以后不支持 bytes, string, int , float以外的数据类型; 将redis降级到2.10.6版本问题解决 阅读全文
posted @ 2020-08-12 02:30 sewen 阅读(441) 评论(0) 推荐(0)
摘要:在用python的django框架进行web开发的时候,出现了一个错误: Traceback (most recent call last): File "D:\Python27\lib\site-packages\django\core\handlers\exception.py", line 4 阅读全文
posted @ 2020-08-11 02:22 sewen 阅读(1376) 评论(0) 推荐(0)
摘要:由于不小心将migrations目录下的0001_initial.py误删,运行makemigrations报错: manage.py@travel > makemigrations "C:\Program Files (x86)\JetBrains\PyCharm 2016.2.3\bin\run 阅读全文
posted @ 2020-08-11 02:02 sewen 阅读(1080) 评论(0) 推荐(0)
摘要:django项目中比较时间参数操作数据库是,产生warning: RuntimeWarning: DateTimeField User.date_joined received a naive datetime (2020-08-01 00:00:00) while time zone suppor 阅读全文
posted @ 2020-08-07 14:43 sewen 阅读(2849) 评论(0) 推荐(0)
摘要:Traceback (most recent call last): File "D:\python_learn\meiduo_project\env\lib\site-packages\django\utils\autoreload.py", line 228, in wrapper fn(*ar 阅读全文
posted @ 2020-08-06 16:45 sewen 阅读(984) 评论(0) 推荐(0)
摘要:查询后发现是,因MarkupSafe==1.0 版本较低, 其引用Feature的方式from setuptools import Feature在新版本的setuptools包中已被弃用,所以导致了上文出现的bug。那解决思路就清晰了,如下思路取一即可。 升级 MarkupSafe==1.1.1 阅读全文
posted @ 2020-08-06 16:37 sewen 阅读(2058) 评论(0) 推荐(0)
摘要:在安装django过滤插件时报错,如下: (venv) D:\python_learn\restfullearn\RESTAPI>pip install django-filter Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simpl 阅读全文
posted @ 2020-08-04 18:28 sewen 阅读(1141) 评论(0) 推荐(0)
摘要:报错如下: (venv) D:\python_learn\restfullearn\RESTAPI>python manage.py startapp book Traceback (most recent call last): File "manage.py", line 22, in <mod 阅读全文
posted @ 2020-07-30 23:10 sewen 阅读(328) 评论(0) 推荐(0)
摘要:Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "D:\python_learn\meiduo_project\env 阅读全文
posted @ 2020-07-28 15:06 sewen 阅读(727) 评论(0) 推荐(0)
摘要:D:\python_learn\meiduo_project\meiduo_mall\meiduo_mall\apps\goods\views.py:38: UnorderedObjectListWarning: Pagination may yield inconsistent results w 阅读全文
posted @ 2020-07-23 18:03 sewen 阅读(919) 评论(1) 推荐(1)
摘要:1.根据课件上的教材重写Storage的url函数,方法如下: from django.core.files.storage import Storage from django.conf import settings class FastDFSStorage(Storage): """自定义文件 阅读全文
posted @ 2020-07-23 05:20 sewen 阅读(605) 评论(3) 推荐(1)
摘要:Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "D:\python_learn\meiduo_project\env 阅读全文
posted @ 2020-07-22 00:37 sewen 阅读(410) 评论(0) 推荐(0)
摘要:class ContentCategory(BaseModel): name = models.CharField(max_length=50, verbose_name='名称') key = models.CharField(max_length=50, verbose_name='类别键名') 阅读全文
posted @ 2020-07-21 21:39 sewen 阅读(489) 评论(0) 推荐(0)
摘要:D:\python_learn\meiduo_project\env\Scripts\python.exe D:/python_learn/meiduo_project/meiduo_mall/manage.py runserver 8000 Traceback (most recent call 阅读全文
posted @ 2020-07-19 15:51 sewen 阅读(630) 评论(0) 推荐(0)
摘要:(env) D:\python_learn\meiduo_project\meiduo_mall>python manage.py makemigrations Traceback (most recent call last): File "manage.py", line 22, in <mod 阅读全文
posted @ 2020-07-18 15:26 sewen 阅读(189) 评论(0) 推荐(0)
摘要:(env) D:\python_learn\meiduo_project\meiduo_mall>python manage.py makemigrations Traceback (most recent call last): File "manage.py", line 22, in <mod 阅读全文
posted @ 2020-07-18 13:04 sewen 阅读(1537) 评论(0) 推荐(0)
摘要:(env) D:\python_learn\meiduo_project\meiduo_mall>python manage.py makemigrations Traceback (most recent call last): File "manage.py", line 22, in <mod 阅读全文
posted @ 2020-07-18 12:57 sewen 阅读(171) 评论(0) 推荐(0)