summaryrefslogtreecommitdiffstats
path: root/stator/views.py
blob: ef09b8ecb9430ceaaa30f98b97a4d8be2628fe03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from django.http import HttpResponse
from django.views import View

from stator.runner import StatorRunner
from users.models import Follow


class RequestRunner(View):
    """
    Runs a Stator runner within a HTTP request. For when you're on something
    serverless.
    """

    async def get(self, request):
        runner = StatorRunner([Follow])
        handled = await runner.run()
        return HttpResponse(f"Handled {handled}")