encode / django-rest-framework

Web APIs for Django. 🎸
https://www.django-rest-framework.org
Other
28.21k stars 6.81k forks source link

Add documentation about how to transform factory request to DRF request #9380

Open mgaligniana opened 5 months ago

mgaligniana commented 5 months ago

Description

Hi there!

As there were many issues opened around this topic: "APIRequestFactory does not return a Request object" I think it would be worth to have a place in the documentation where explains it.

Following the Tom's comment in the last issue https://github.com/encode/django-rest-framework/issues/6488#issuecomment-2049940926:

If someone's invested and there's clearly a good existing place in the docs to highlight this, then we could accept a docs PR here.

*Past issues related: https://github.com/encode/django-rest-framework/issues/4440 and https://github.com/encode/django-rest-framework/issues/3608

This is what my proposal looks like:

image

I've also added a test to follow the Carlton's comment https://github.com/encode/django-rest-framework/issues/6488#issuecomment-2048962774

Thank you!

mgaligniana commented 5 months ago

Hi @carltongibson! Is something like that the documentation you had in mind?