Skip to main content

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 gifts URLconf in your project urls.py like this:

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

    => CREATE VIEW v_staff 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 http://127.0.0.1:8000/reports/staff/ or http://127.0.0.1:8000/reports/v_staff/ 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.

Release History

0.5.5 (2015-08-25)

Bugfixes

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

0.5.4 (2015-08-09)

Bugfixes

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

0.5.3 (2015-08-05)

Improvements

  • Update documentation.

  • Rename PyPI package to django-view-export.

Project details


Download files

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

Source Distribution

django-view-export-0.5.5.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_view_export-0.5.5-py2-none-any.whl (5.9 kB view details)

Uploaded Python 2

File details

Details for the file django-view-export-0.5.5.tar.gz.

File metadata

File hashes

Hashes for django-view-export-0.5.5.tar.gz
Algorithm Hash digest
SHA256 d142aa6e33eb69257298fecf892ba38d6e15244a0b4cf414100b838d3ef6c94c
MD5 e43aed6602097c230efbd6165869bd87
BLAKE2b-256 5d1413437b639e72df0019c59aedfd0591d9d046c4e0a157cd60ade82772153c

See more details on using hashes here.

File details

Details for the file django_view_export-0.5.5-py2-none-any.whl.

File metadata

File hashes

Hashes for django_view_export-0.5.5-py2-none-any.whl
Algorithm Hash digest
SHA256 a0fc61171856c7e0eb9d4a6aa3965b0be59462707793828a02ec12d666368b34
MD5 63b17b6181ec46a0b2c1af45a7eb4ce9
BLAKE2b-256 7ec2a19ad41ec2c076892b5842c7b880d034862776ac5659249208d5a352c30f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page