Closed spirovskib closed 1 year ago
The solution in my PR could be to set the value of "wsgi.input"
to a file-like object, like BytesIO(body)
.
Please share if the PR is merged in a new release and whether I need to configure something in order for the process to run properly for Django 4.2+
Yes of course, let's wait for a review from the maintainer.
If you need it ASAP, then just switch your requirements line from
zappa==0.56.1
to
zappa @ https://github.com/dennybiasiolli/Zappa/archive/refs/heads/django42.zip
So you can test it with Django 4.2 (and eventually provide another feedback other than mine)
Great, task for the weekend.
@dennybiasiolli I'm building a new project with Django 4.2 and I'm facing the same error mentioned in the thread. I wanted to try out the updated package using zappa @ https://github.com/dennybiasiolli/Zappa/archive/refs/heads/django42.zip
, but it seems like the package doesn't exist there anymore. If possible, can you please share an updated location for django42.zip, so that I can test it and provide feedback as well?
Here's the error I'm getting:
ERROR: HTTP error 404 while getting https://github.com/dennybiasiolli/Zappa/archive/refs/heads/django42.zip
ERROR: Could not install requirement zappa@ https://github.com/dennybiasiolli/Zappa/archive/refs/heads/django42.zip from https://github.com/dennybiasiolli/Zappa/archive/refs/heads/django42.zip (from -r requirements.txt (line 33)) because of HTTP error 404 Client Error: Not Found for url: https://codeload.github.com/dennybiasiolli/Zappa/zip/refs/heads/django42 for URL https://github.com/dennybiasiolli/Zappa/archive/refs/heads/django42.zip
@symbiot-india my pull request has been approved and merged into Zappa:master, so you can use the official zappa repo with zappa @ https://github.com/zappa/Zappa/archive/refs/heads/master.zip
or other official methods like git+https or similar.
Thanks! I will try this out.
Great, it's working now with Django 4.2! Thanks Denny
Fixed for me as well. Thank you.
Fixed in 0.57.0 release, published to pypi 5/19, closing.
Context
I am running a Django web application as Lambda deployed on AWS via zappa I upgraded Django to 4.2 on my application to remedy security issues reported by Github Dependabot. Local testing didn't reveal any issues. After upgrading i ran
zappa update production
and the deployment failed, with zappa deployment reporting error 500 upon deployment. In the zappa log i found the following error:'NoneType' object has no attribute 'read'
I found another comment on Django forums that's closed as Django making a breaking change that requires changes in the way WSGIRequest is invoked https://code.djangoproject.com/ticket/34350 At this moment I reverted back to Django 4.1.8 for the application to run.Is there any proper upgrade path of libraries to make Django 4.2 work?
Expected Behavior
Upgrading Django and redeployment via zappa should be trivial. Previously I have done this many times. On local testing everything is working properly.
Actual Behavior
Error 500 on redeployment through Zappa, and in the zappa log the following error:
'NoneType' object has no attribute 'read'
Possible Fix
Revert back to Django 4.1.8 for the application to run. This will make sense in the short term, but I'm looking for a long term fix.
Steps to Reproduce
zappa update application
zappa tail application
logs one can see "NoneType' object has no attribute 'read'"Your Environment
pip freeze
:zappa_settings.json
: