Skip to main content

Use Google Sheets as context variables in Django templates

Project description

Use Google Sheets as context variables in Django templates

https://badge.fury.io/py/django-sheets.png https://travis-ci.org/georgewhewell/django-sheets.png?branch=master https://coveralls.io/repos/georgewhewell/django-sheets/badge.png?branch=master Requirements Status

Usage

In your template:

{% load sheets %}
{% csv "1uPsdcGUnUsf3d2xGHRGUUb7_k5IQPtBvfQY61u8Z8wE" as data %}
<table>
    <thead>
        <tr>
        {% for header in data.headers %}
            <th>{{ header }}</th>
        {% endfor %}
        </tr>
    </thead>
    <tbody>
        {% for row in data.rows %}
        <tr>
            {% for cell in row %}
                <td>{{ cell }}</td>
            {% endfor %}
        </tr>
        {% endfor %}
    </tbody>
</table>

View the output, you should see

Origin (English)

Name (English)

Origin (Native)

Name (Native)

Australia

Nicole Kidman

Australia

Nicole Kidman

Austria

Johann Strauss

Österreich

Johann Strauß

Belgium (Flemish)

Rene Magritte

België

René Magritte

Belgium (French)

Rene Magritte

Belgique

René Magritte

Belgium (German)

Rene Magritte

Belgien

René Magritte

Documentation

Documentation is available at https://django-sheets.readthedocs.org.

History

0.1.2 (2014-24-03)

  • Added gid parameter for multi-sheet documents

0.1.1 (2014-22-01)

  • Added .headers and .rows methods (aliases for [0] and [1:])

0.1.0 (2014-18-01)

  • First release on PyPI.

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-sheets-0.1.2.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file django-sheets-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django-sheets-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b7769bd50fcc62c64edbb9432ee4f8a950e8c863ec3dbba65785eb4aea3fd277
MD5 3da6905f972e4e4776366af54b092802
BLAKE2b-256 bb3c1df0a339e5aa2a8c880624b435ed7543d6b214b4004f81e992d82b87acca

See more details on using hashes here.

Supported by

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