Getting started

  1. Add django-withings to your Django site’s requirements, however you prefer, and install it. It’s installable from PyPI.
  1. Add withingsapp to your INSTALLED_APPS setting:

    INSTALLED_APPS += ['withingsapp']
    
  2. Add the django-withings URLs to your URLconf:

    url(r'^withings/', include('withingsapp.urls')),
    
  1. Register your site at the Withings developer site to get a key and secret.

  2. Add settings for WITHINGS_CONSUMER_KEY and WITHINGS_CONSUMER_SECRET:

    WITHINGS_CONSUMER_KEY = 'abcdefg123456'
    WITHINGS_CONSUMER_SECRET = 'abcdefg123456'
    
  3. If you need to change the defaults, add settings for WITHINGS_LOGIN_REDIRECT, WITHINGS_LOGOUT_REDIRECT, and/or WITHINGS_ERROR_TEMPLATE.

  4. To display whether the user has integrated their Withings, or change a template behavior, use the is_integrated_with_withings template filter. Or in a view, call the withingsapp.utils.is_integrated() function. You can also use the decorator withingsapp.decorators.withings_integration_warning() to display a message to the user when they are not integrated with Withings.

  5. To send the user through authorization at the Withings site for your app to access their data, send them to the withingsapp.views.login() view.