<commit_before>import django
django.setup()

import json
import redis
import rq
import requests
import time

from pywebpush import WebPusher
from hyper.contrib import HTTP20Adapter

from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from django.views.decorators.http import require_POST

from .models import DeviceToken


REDIS_CLIENT = redis.Redis(settings.REDIS_HOST, settings.REDIS_PORT, db=0)


@csrf_exempt
@require_POST
def send_push_notification(request):
    queue = rq.Queue(connection=REDIS_CLIENT)
    to_username = request.POST.get("to")<commit_msg>Setup django before the enqueue.<commit_after>import json
import redis
import rq
import requests
import time

from pywebpush import WebPusher
from hyper.contrib import HTTP20Adapter

from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from django.views.decorators.http import require_POST

from .models import DeviceToken


REDIS_CLIENT = redis.Redis(settings.REDIS_HOST, settings.REDIS_PORT, db=0)


@csrf_exempt
@require_POST
def send_push_notification(request):
    import django
    django.setup()

    queue = rq.Queue(connection=REDIS_CLIENT)
    to_username = request.POST.get("to")
{'fraction_non_alphanumeric': 0.065738592420727, 'fraction_numerical': 0.004640371229698376, 'mean_word_length': 5.810526315789474, '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': '2074652', 'n_tokens_mistral': 396, 'n_tokens_neox': 396, 'n_words': 109}