@require_setting('TRELLO_APP_KEY')
@login_required
@require_POST
def trello_settings(request):
    token = request.POST.get('token')
    url = ('https://api.trello.com/1/members/me/boards?' + urlencode({'key': settings.TRELLO_APP_KEY, 'token': token, 'fields': 'id,name', 'lists': 'open', 'list_fields': 'id,name'}))
    r = requests.get(url)
    ctx = {'token': token, 'data': r.json()}
    return render(request, 'integrations/trello_settings.html', ctx)
@require_setting('TRELLO_APP_KEY')
@login_required
@require_POST
def trello_settings(request):
    token = request.POST.get('token')
    url = ('https://api.trello.com/1/members/me/boards?' + urlencode({'key': settings.TRELLO_APP_KEY, 'token': token, 'fields': 'id,name', 'lists': 'open', 'list_fields': 'id,name'}))
    r = requests.get(url)
    ctx = {'token': token, 'data': r.json()}
    return render(request, 'integrations/trello_settings.html', ctx)