我在Python 3.4,Django 1.7.3和Visual Studio中的PTVS上构建了一个非常简单的应用程序。本地一切都很好但是当我发布到Azure Python网站时我得到了
Traceback (most recent call last): File ".\app\views.py", line 69, in home rml2pdf.go(rml, outputFileName=buf) File "rlextra-3.1.45/src/rlextra/rml2pdf/rml2pdf.py", line 5638, in go ImportError: DLL load failed: %1 is not a valid Win32 application.
最重要的是DLL load failed: %1 is not a valid Win32 application.
。这是我的代码,
try:
from io import BytesIO
buf = BytesIO()
rml2pdf.go(rml, outputFileName=buf)
buf.seek(0)
pdfData = buf.read()
response = HttpResponse(content_type='application/pdf')
response.write(pdfData)
response['Content-Disposition'] = 'attachment; filename=output.pdf'
return response
except:
response = HttpResponse()
response.write(traceback.format_exc())
return response
我已经从Azure门户网站将32位更改为64位但没有运气。
答案 0 :(得分:1)
我已按照http://azure.microsoft.com/en-us/documentation/articles/web-sites-python-create-deploy-django-app/的所有步骤进行操作。现在它的工作。问题可能在于发布。