-
-
Couldn't load subscription status.
- Fork 404
Description
Description
Currently, the only place we're using Django REST Framework is for our file upload endpoint: api/db/v0/data_files.
We can simplify this by converting it to a regular Django view, which will make the codebase cleaner and much easier to work with.
We have already figured out how to handle file uploads with view while working on the bulk_insert/ endpoint.
Additionally, This removal would delete >1000 lines of code, along with an additional dependency drf-access-policy which we no longer use.
Affects users
None
Affects developers
Medium
- Simplifies the file upload logic.
- Removal of 1 major and 1 minor dependency we won't have to maintain.
- Removal of outdated error handling systems.
- No DRF magic, So, easy debugging.
Suggested change
- Use a multipart form parser along with a django view, similar to how we do with
bulk_insert/to handle file uploads. - Remove DRF code imports and settings.
Additional context
This is a really low hanging fruit, that can be done in 1-2 hrs. A little bit of frontend changes might be required as there might be a change it the url of the endpoint when we get drf out of the codebase.