
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
djangorestframework-more
Advanced tools
:warning: Warning NonPaginatedXLSXRenderer does not work with newer versions of drf-renderer-xlsx. Please set your version of drf-renderer-xlsx to 0.3.8.
More Cool Django Rest Framework Stuff
pip3 install djangorestframework-more or pipenv install djangorestframework-more
In case you want a CSV or XLSX (Excel) renderer that doesn't respect pagination:
# in settings.py
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': [
'rest_framework.renderers.JSONRenderer',
'rest_framework.renderers.BrowsableAPIRenderer',
'rest_framework_more.renderers.NonPaginatedCSVRenderer',
'rest_framework_more.renderers.NonPaginatedXLSXRenderer'
]
}
If you'd like to learn more about using renderers in Django Rest Framework, see https://www.django-rest-framework.org/api-guide/renderers/#setting-the-renderers
# in serializers.py
from app.models import Car
from rest_framework_more.serializers import create_model_serializer_class
CarSerializer = create_model_serializer_class(model=Car)
# forms.py
from app.models import Car
from rest_framework_more.filters import create_model_filter_form
CarFilterForm = create_model_filter_form(model=Car)
# forms.py
from app.models import Car
from rest_framework_more.filters import create_model_filterset_class
CarFilterSet = create_model_filterset_class(model=Car)
# views.py
from app.models import Car
from rest_framework_more.viewsets import create_model_viewset_class
CarViewSet = create_model_viewset_class(model=Car)
The FileNameMixin automatically generates a more descriptive filename for CSV and Excel exports than the default "download". It first tries to convert the url path into a filename. If that doesn't succeed it tries to pull the filename from the queryset's model.
# views.py
from rest_framework_more.mixins import FileNameMixin
class CarViewSet(FileNameMixin, ReadOnlyModelViewSet):
...
# if the CarViewSet is called from the url /api/cars it will generate a download filename of api_cars.csv
If you have any issues, feel free to post an issue at https://github.com/DanielJDufour/django-rest-framework-more/issues or email the package author at daniel.j.dufour@gmail.com
FAQs
More Cool Django Rest Framework Stuff
We found that djangorestframework-more demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.