django-google-health demo

{% if messages %} {% endif %} {% if connection and connection.status == 'active' %}
Google Health connected
Google user ID: {{ connection.google_user_id }}
Status: {{ connection.status }} · Token: {% if connection.is_token_expired %}expired{% else %}valid{% endif %} (expires {{ connection.token_expires_at }}) · Last sync: {{ connection.last_sync_at|default:"never" }}
{% csrf_token %}
{% if connection.is_token_expired %}
Access token expired.
A sync will try to refresh it; if the refresh token is also expired or revoked (an invalid_grant on sync), re-authorize to mint a new one.
Re-authorize
{% endif %}
{{ record_count }} record(s) · {{ workout_count }} workout(s) in healthdatamodel
Browse records
Re-authorize
{% csrf_token %}
{% elif connection and connection.status == 'unlinked' %}
This Google account isn't linked to Google Health.
The account you authorized has no Fitbit profile, so every sync will fail. Reconnect with the Google account that holds your Fitbit data — or create a profile for this one first. (Enterprise/Workspace accounts generally can't hold Fitbit profiles.)
Reconnect
{% else %}
{% if connection %} Google Health {{ connection.status }}.
This connection can no longer sync. Re-authorize to resume. {% else %} Not connected to Google Health.
You'll be sent to Google for consent, then back here. {% endif %}
{% if connection %}Re-authorize{% else %}Connect Google Health{% endif %}
{% endif %}