-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request.files raises AttributeError #3261
Labels
Milestone
Comments
Yup, this is me having a major brain-fail. Apologies, not sure why I thought Use |
Alright, will do. Thanks for the insanely fast response! |
This was referenced Mar 9, 2017
This was referenced Oct 16, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This might just be me being confused, or an error in the docs. I'm on 3.2.1, and I'm trying to handle uploading files, using
request.files
as it says I should do in the 3.2 announcement. I'm aware that because of #3239request.FILES
still works, but I'm trying to use the more favourable attribute. However, this gives me an AttributeError, for some reason:Using
request.data
instead ofrequest.DATA
seems to work fine. I'm working in a view which subclassesGenericAPIView
directly, and also uses thepost
method directly for direct request and response handling.There is also in inconsistency in the docs. In the announcement of 3.2, it says "request.FILES was put on the deprecation path in 3.0. It has now been removed and its usage will result in an error. Use the more pythonic style of request.files instead.". However, in the Requests section of the API guide, it says "The old-style version 2.x request.DATA and request.FILES attributes are still available, but are now pending deprecation in favor of the unified request.data attribute.". This seems inconsistent to me, because it makes me think I shouldn't use
request.files
at all, but onlyrequest.data
.The text was updated successfully, but these errors were encountered: