<commit_before>from dropbox.client import DropboxOAuth2Flow

from django.conf import settings
from django.core.urlresolvers import reverse

from dimagi.utils.web import get_url_base


def get_dropbox_auth_flow(session):
    from .views import DropboxAuthCallback

    redirect_uri = '{}{}'.format(
        get_url_base(),
        reverse(DropboxAuthCallback.slug),
    )
    return DropboxOAuth2Flow(settings.DROPBOX_KEY, settings.DROPBOX_SECRET, redirect_uri,
         session, "dropbox-auth-csrf-token")<commit_msg>make csrf token a constant<commit_after>from dropbox.client import DropboxOAuth2Flow

from django.conf import settings
from django.core.urlresolvers import reverse

from dimagi.utils.web import get_url_base


DROPBOX_CSRF_TOKEN = 'dropbox-auth-csrf-token'


def get_dropbox_auth_flow(session):
    from .views import DropboxAuthCallback

    redirect_uri = '{}{}'.format(
        get_url_base(),
        reverse(DropboxAuthCallback.slug),
    )
    return DropboxOAuth2Flow(settings.DROPBOX_KEY, settings.DROPBOX_SECRET, redirect_uri,
         session, DROPBOX_CSRF_TOKEN)
{'fraction_non_alphanumeric': 0.07988980716253444, 'fraction_numerical': 0.0036730945821854912, 'mean_word_length': 4.561224489795919, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1754515', 'n_tokens_mistral': 351, 'n_tokens_neox': 350, 'n_words': 69}