<commit_before>from django.conf import settings

def media(request):
    media_url = getattr(settings, 'CLIENT_MEDIA_URL', settings.MEDIA_URL)
    js_url = getattr(settings, 'CLIENT_JS_URL', media_url + 'js/')
    return {
        'CLIENT_MEDIA_URL': media_url,
        'CLIENT_JS_URL': js_url
    }<commit_msg>simplified requirement in settings by adding defaults for constructing the client urls<commit_after>from django.conf import settings

def media(request):
    CLIENT_MEDIA_URL = getattr(settings, 'CLIENT_MEDIA_URL',
        settings.MEDIA_URL)
    CLIENT_JS_URL = getattr(settings, 'CLIENT_JS_URL', None)
    
    if CLIENT_JS_URL is None:
        SRC_DIR = getattr(settings, 'SRC_DIR', 'src')
        MIN_DIR = getattr(settings, 'MIN_DIR', 'min')
        _dir = settings.DEBUG and SRC_DIR or MIN_DIR
        CLIENT_JS_URL = '%sjs/%s/' % (CLIENT_MEDIA_URL, _dir)

    return {
        'CLIENT_MEDIA_URL': CLIENT_MEDIA_URL,
        'CLIENT_JS_URL': CLIENT_JS_URL
    }
{'fraction_non_alphanumeric': 0.10030706243602866, 'fraction_numerical': 0.0, 'mean_word_length': 3.6794258373205744, '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': '3738421', 'n_tokens_mistral': 342, 'n_tokens_neox': 339, 'n_words': 72}