zoukankan      html  css  js  c++  java
  • 做Vue+Django REST framework电商项目遇到的问题

    问题1:

    刷新前端注册页面图片验证码显示不出来的时候(image_id临时保存在redis中)
    前端检查里的console显示:
    (507) Insufficient Storage

    Django后端报错:

    ERROR exceptions 26 [<verifications.views.ImageCodeView object at 0x000000000514BA20>] MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
    ERROR basehttp 124 "GET /image_codes/ca845c7c-c3ac-4ca9-ae3f-652027381c7b/ HTTP/1.1" 507 35

    大意为:(错误)misconf redis被配置以保存数据库快照,但misconf redis目前不能在硬盘上持久化。用来修改数据集合的命令不能用,请使用日志的错误详细信息。

    这是由于强制停止redis快照,不能持久化引起的

    解决方法:通过redis-cli连接到服务器后执行以下命令:

    config set stop-writes-on-bgsave-error no

    问题2:

    测试web时,报错:django.template.exceptions.TemplateDoesNotExist: rest_framework/api.html

    Django后端报错:

    django.template.exceptions.TemplateDoesNotExist: rest_framework/api.html
    ERROR basehttp 124 "GET /sms_codes/18516952650/?text=nmub&image_code_id=e5d4c09a-6cf2-43d3-931e-18e158a1b6b9 HTTP/1.1" 500 85501

    解决办法:    

                在配置文件中配置rest_framework库,setting文件中的参数INSTALLED_APPS加上rest_framework

    问题3:

    windows下执行命令celery -A celery_tasks.main worker -l info报错:

    Task handler raised error: ValueError('not enough values to unpack (expected 3, got 0)',)

    查询到的原因是:celery4版本起已经不支持windows了(linux下不会报错)

    需要先安装pip install eventlet这个模块,然后执行以下命令:celery -A celery_tasks.main worker -l info -P eventlet

  • 相关阅读:
    python 列表与字符串互相转化
    python爬虫——BeautifulSoup详解(附加css选择器)
    python——requests库
    用代理池 + redis 刷博客浏览量(2)
    scrapy爬取知乎用户信息并存入mongodb
    python 爬虫 计算博客园浏览量,刷浏览量(1)
    python SocketServer模块创建TCP服务器·
    【XSY1986】【BZOJ1455】罗马游戏
    【模板】左偏树
    CF464D World of Darkraft
  • 原文地址:https://www.cnblogs.com/zhangdajin/p/11124238.html
Copyright © 2011-2022 走看看