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!

Export CSV reports of database views.

Project Description

Generate CSV reports by simply creating SQL views.

Authenticated staff members can then directly download these reports as CSV. It’s a nice agile way to deal with the changing requirements for reports.

Quick start

  1. Include the URLconf in your project like this:

    url(r'^reports/', include('view_export.urls')),
  2. Create an SQL view in your database:

    => CREATE VIEW v_staff_names AS (
    ->      SELECT first_name, last_name FROM auth_user
    ->      WHERE is_staff = TRUE);

    You’ll probably want to record this SQL in a file such as reports.sql or even better, add it to a Django migration.

  3. Start the development server and visit or to download the SQL view named v_staff as a CSV file.

No settings are required by default and there’s no need to add the package to Django’s INSTALLED_APPS. Staff login access is required, so you may wish to set the LOGIN_URL setting to /admin/login/ initially.

Release History

0.7.1 (2017-02-07)

  • remove patterns URLconf function per deprecation in Django 1.8
  • fix example URLs in README
  • provide example view with underscores
  • document staff-only access and LOGIN_URL setting

0.6.2 (2015-09-04)


  • Fix installation error due to HISTORY.rst not being present in source.

0.6.1 (2015-08-25)


  • Switch to Python 3 only, factor out CSV and report filename generation.

0.5.5 (2015-08-25)


  • Fix installation error due to HISTORY.rst not being present in source.

0.5.4 (2015-08-09)


  • Fix SQL injection vulnerability relating to “view” argument.

0.5.3 (2015-08-05)


  • Update documentation.
  • Rename PyPI package to django-view-export.

Release History

This version
History Node


History Node


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
(7.7 kB) Copy SHA256 Hash SHA256
Wheel py3 Feb 7, 2017
(4.6 kB) Copy SHA256 Hash SHA256
Source None Feb 7, 2017

Supported By

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