I have build a very simple application on Python 3.4, Django 1.7.3 with PTVS in Visual Studio. Locally everything fine but when I publish to Azure Python website I am getting
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.
Most importantly DLL load failed: %1 is not a valid Win32 application.
. Here is my code,
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
I have changed 32bit to 64 bit from Azure portal but no luck.
I have followed all steps at http://azure.microsoft.com/en-us/documentation/articles/web-sites-python-create-deploy-django-app/. Now its working. The problem may be with publishing.