• 细节性的错误


    ERROR exception 135 Internal Server Error: /apple/login/
    Traceback (most recent call last):
      File "/home/python/.virtualenvs/py3/lib/python3.5/site-packages/django/core/handlers/exception.py", line 41, in inner
        response = get_response(request)
      File "/home/python/.virtualenvs/py3/lib/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response
        response = self.process_exception_by_middleware(e, request)
      File "/home/python/.virtualenvs/py3/lib/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response
        response = wrapped_callback(request, *callback_args, **callback_kwargs)
      File "/home/python/.virtualenvs/py3/lib/python3.5/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
        return view_func(*args, **kwargs)
      File "/home/python/.virtualenvs/py3/lib/python3.5/site-packages/django/views/generic/base.py", line 68, in view
        return self.dispatch(request, *args, **kwargs)
      File "/home/python/.virtualenvs/py3/lib/python3.5/site-packages/rest_framework/views.py", line 483, in dispatch
        response = self.handle_exception(exc)
      File "/home/python/.virtualenvs/py3/lib/python3.5/site-packages/rest_framework/views.py", line 443, in handle_exception
        self.raise_uncaught_exception(exc)
      File "/home/python/.virtualenvs/py3/lib/python3.5/site-packages/rest_framework/views.py", line 480, in dispatch
        response = handler(request, *args, **kwargs)
      File "/home/python/Desktop/dongliang/dongliang/apps/wechat/views.py", line 661, in post
        response = applet.create_token(encryptedData, iv)
      File "/home/python/Desktop/dongliang/dongliang/apps/wechat/applet_utls.py", line 68, in create_token
        oauth_user = OAuthUser.objects.get(weixin_unionid=user_dict_data['unionid'])
    KeyError: 'unionid'
    ERROR basehttp 124 "POST /apple/login/ HTTP/1.1" 500 21729
    Performing system checks...
    

     解决和错误原因

     oauth_user = OAuthUser.objects.get(weixin_unionid=user_dict_data['unionid'])

     取不到 unionid

     原来是 unionId

     注意细节

  • 相关阅读:
    关于pipe管道的读写端关闭问题
    线性表的链式存储——C语言实现
    关于无法解析的外部符号 _main
    Tomcat域名与服务器多对多配置
    JavaScript基础
    Vue.js入门
    SpringBoot注解大全,收藏一波!!!
    数据库连接错误
    SpringBoot入门
    MyBatis插入并返回id技巧
  • 原文地址:https://www.cnblogs.com/Xingtxx/p/10937065.html
Copyright © 2020-2023  润新知