Skip to content
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

[Enhancement] : Add middleware for PATCH | PUT file upload #719

Closed
wants to merge 6 commits into from
Closed

[Enhancement] : Add middleware for PATCH | PUT file upload #719

wants to merge 6 commits into from

Conversation

baseplate-admin
Copy link
Contributor

Closes #716

This reverts commit 9159491, reversing
changes made to eed29fd.

[`Enhancement`] : Add middleware

Update middlewares.py

Update middlewares.py

Fix mypy

Update test_middleware.py

Run isort and fix async codes

Fox Sync Codes

Sync Middleware test complete

add

Create test_middleware.py

Update middlewares.py

Delete foo.txt

Update test_middleware.py

Update test_middleware.py

Update test_middleware.py

[Docs] : Run isort

Update install_env.sh

Update middlewares.py

Update middlewares.py

Update test_middleware.py
@baseplate-admin
Copy link
Contributor Author

baseplate-admin commented Mar 28, 2023

Hi @vitalik ,

we have run into an error. Async middlewares are only supported in 3.1 and upwards. Do you want me to drop the async middleware to keep compatibility or do you want me to bump django version to 3.1 and upwards.

the problematic import is
from django.utils.decorators import sync_and_async_middleware

This class isn't available in django 3.1 and earlier.


My opinion on this matter is that make a repository that will have this specific code and then link to the docs about this middleware and when we finally drop django 3.1 support we will merge this into main branch


Or maybe look into core and see how we can patch it without using a middleware. ( like how django-rest-framework does things )

@baseplate-admin
Copy link
Contributor Author

baseplate-admin commented Mar 29, 2023

Django 2 is EOL.

In my opinion we should target 3.2 and upwards

Update pyproject.toml

remove old django

Update test_middleware.py

Remove

run `black`

Run `isort`

Update pyproject.toml

Update test_full.yml
Ignore The coverage of this line because it works in the file
@baseplate-admin baseplate-admin marked this pull request as ready for review March 29, 2023 08:04
@baseplate-admin
Copy link
Contributor Author

Hey @vitalik ,

I have skipped coverage on middleware as the middleware works as expected :)

@baseplate-admin
Copy link
Contributor Author

merge this after #720

@baseplate-admin
Copy link
Contributor Author

Hi @vitalik,

Due to the lack of input on this Pull Request i have made ninja-put-patch-file-upload-middleware

Feel free to open this pull request again to continue the progress here.

Thank you again for creating django-ninja .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] : Add file upload middleware to docs
1 participant