Django View Export
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
Include the URLconf in your project urls.py like this:
path('reports/', include('view_export.urls')),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.
Start the development server and visit http://127.0.0.1:8000/reports/staff_names/ or http://127.0.0.1:8000/reports/v_staff_names/ 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
1.0.0 (2021-09-28)
Upgrade for Python 3.6 and Django 3.2.
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)
Bugfixes
Fix installation error due to HISTORY.rst not being present in source.
0.6.1 (2015-08-25)
Improvements
Switch to Python 3 only, factor out CSV and report filename generation.
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.
Metadata
Release files for django-view-export 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-view-export-1.0.0.tar.gz | 5.1 kB | Without provenance | Details for django-view-export-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_view_export-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for django_view_export-1.0.0-py3-none-any.whl |
Total release size: 11.6 kB
Release files / django-view-export-1.0.0.tar.gz
| Download URL | django-view-export-1.0.0.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c282a56502ff2ce496486b7d0455aac7c209737ccfa55d36c919924cdbecd2a7
|
|
BLAKE2b-256 checksum How to use checksums |
11438adbc68fbc1d2cb4cf9a00d237e483e7cfab6a3cc4b8cbd1c2fba1cca6a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.7.0 requests/2.25.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.2
|
Release files / django_view_export-1.0.0-py3-none-any.whl
| Download URL | django_view_export-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86a10282353e86ddf6f8b79e557362c00290d33a4509b9c467017d82d72ed81d
|
|
BLAKE2b-256 checksum How to use checksums |
f1a03815ceda3bcbaf47a76d23a517147fe854043069abbab745c22e30757690
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.7.0 requests/2.25.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.2
|
Security for django-view-export 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.