Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Django package to easily render Excel spreadsheets

Project Description

A subclass of HttpResponse which will transform a QuerySet, or sequence of sequences, into either an Excel spreadsheet or CSV file formatted for Excel, depending on the amount of data.


pip install django-excel-response

Provided Classes

  • excel_response.response.ExcelResponse

    Accepted arguments:

    • data - A queryset or list of lists from which to construct the output
    • output_filename - The filename which should be suggested in the http response, minus the file extension (default: excel_data)
    • worksheet_name - The name of the worksheet inside the spreadsheet into which the data will be inserted (default: None)
    • force_csv - A boolean stating whether to force CSV output (default: False)
    • header_font - The font to be applied to the header row of the spreadsheet; must be an instance of openpyxl.styles.Font (default: None)
    • data_font - The font to be applied to all data cells in the spreadsheet; must be an instance of openpyxl.styles.Font (default: None)
  • excel_response.views.ExcelMixin

  • excel_response.views.ExcelView


Function-based views

You can construct your data from a queryset.

from excel_response import ExcelResponse

def excelview(request):
    objs = SomeModel.objects.all()
    return ExcelResponse(objs)

Or you can construct your data manually.

from excel_response import ExcelResponse

def excelview(request):
    data = [
        ['Column 1', 'Column 2'],
    return ExcelResponse(data, 'my_data')

Class-based views

These are as simple as import and go!

from excel_response import ExcelView

class ModelExportView(ExcelView):
    model = SomeModel

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(10.1 kB) Copy SHA256 Hash SHA256
Source None Jan 26, 2018

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers