小编Ale*_*lex的帖子

“AssertionError”对象没有属性“message”

我正在处理 django 中的表单,一旦填写完毕,就会向用户发送一封电子邮件,但我收到以下错误:

错误图像

我已经检查了我的代码,我的问题来自这个函数:

def send_manually_exception_email(request, e):
  exc_info = sys.exc_info()
  reporter = ExceptionReporter(request, is_email=True, *exc_info)
  subject = e.message.replace('\n', '\\n').replace('\r', '\\r')[:989]
  message = "%s\n\n%s" % (
    '\n'.join(traceback.format_exception(*exc_info)),
    reporter.filter.get_request_repr(request)
  )
  mail.mail_admins(subject, message, fail_silently=True, html_message=reporter.get_traceback_html())
Run Code Online (Sandbox Code Playgroud)

我能做些什么?

email django django-forms python-3.x django-oscar

3
推荐指数
1
解决办法
2万
查看次数

DistutilsError:找不到 Requirement.parse('setuptools-scm') 的合适发行版

您好,当尝试将 django 应用程序部署到 elastic beanstalk 时,会出现此错误,

DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools-scm')
Run Code Online (Sandbox Code Playgroud)

我尝试在我的requirements.txt 文件甚至我的.ebextension 目录中添加库setuptools-scm,但仍然没有任何建议?

编辑,这是错误的完整日志:

Application deployment failed at 2021-05-18T23:56:56Z with exit status 1 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. Collecting Django==1.11.16 Using cached Django-1.11.16-py2.py3-none-any.whl (7.0 MB) Collecting django-oscar==1.6.4 Using cached django_oscar-1.6.4-py2.py3-none-any.whl (7.5 MB) Collecting psycopg2==2.7.3.2 Using cached psycopg2-2.7.3.2-cp36-cp36m-manylinux1_x86_64.whl (2.7 MB) Collecting openpyxl==2.4.10 Using cached openpyxl-2.4.10.tar.gz (158 kB) Collecting django-storages==1.6.5 Using cached django_storages-1.6.5-py2.py3-none-any.whl (47 kB) Collecting boto3==1.5.19 Using cached boto3-1.5.19-py2.py3-none-any.whl (128 kB) Collecting django-ipware==2.0.1 Using cached django-ipware-2.0.1.tar.gz (10 …

setuptools django-haystack python-3.x amazon-elastic-beanstalk

2
推荐指数
1
解决办法
1万
查看次数