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.
WARNING: Be sure to retain the “staff only” restriction in place on views.csv_view_export to reduce the risk of SQL injection attack.
Quick start
Include the gifts URLconf in your project urls.py like this:
url(r'^reports/', include('view_export.urls')),
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.
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.1 (2015-08-05)
Improvements
Update documentation.
Rename PyPI package to django-view-export.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_view_export-0.5.3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13fc38e12abd0f233c0dde7f6f2633b377bc841c72dd3f1ba3ccbaa59582c5c8 |
|
MD5 | e237b602588bb9848cf67a983d3b63bc |
|
BLAKE2b-256 | d2205166c6a465b2854881d1958be8f72548737d4fcec56543f4659c6bd7af7e |