<commit_before>import time
import base64
import hmac
import sha
import urllib
import hashlib

from django.utils import timezone

from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import (
    IsAdminUser,
    IsAuthenticated,
)
from rest_framework.response import Response
from rest_framework.views import APIView

from pebbles.models import PebbleSettings

from petroglyphs.models import Setting


class S3SignView(APIView):
    authentication_classes = (SessionAuthentication,)
    permission_classes = (IsAuthenticated,)

    def get(self, request, format=None):
        AWS_ACCESS_KEY = str(Setting.objects.get(key='aws_access_key').value)
        AWS_SECRET_KEY = str(Setting.objects.get(key='aws_secret_key').value)<commit_msg>Only return JSON from the s3 signing endpoint.<commit_after>import time
import base64
import hmac
import sha
import urllib
import hashlib

from django.utils import timezone

from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import (
    IsAdminUser,
    IsAuthenticated,
)
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.renderers import JSONRenderer

from pebbles.models import PebbleSettings

from petroglyphs.models import Setting


class S3SignView(APIView):
    authentication_classes = (SessionAuthentication,)
    permission_classes = (IsAuthenticated,)
    renderer_classes = (JSONRenderer,)

    def get(self, request, format=None):
        AWS_ACCESS_KEY = str(Setting.objects.get(key='aws_access_key').value)
        AWS_SECRET_KEY = str(Setting.objects.get(key='aws_secret_key').value)
{'fraction_non_alphanumeric': 0.06666666666666667, 'fraction_numerical': 0.004166666666666667, 'mean_word_length': 5.644268774703558, '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': '291411', 'n_tokens_mistral': 480, 'n_tokens_neox': 475, 'n_words': 122}