2021-08-22 20:10:29 +02:00
|
|
|
from django.http import HttpResponse
|
2021-09-11 19:09:22 +02:00
|
|
|
from django.shortcuts import render
|
2021-09-14 17:32:51 +02:00
|
|
|
from django.views.generic import TemplateView
|
2021-09-11 19:09:22 +02:00
|
|
|
from sentry_sdk import last_event_id
|
2021-08-22 20:10:29 +02:00
|
|
|
|
2021-09-11 19:09:22 +02:00
|
|
|
from rpg_notes.secrets import SENTRY_DSN
|
2021-08-29 22:09:22 +02:00
|
|
|
from utils.assets import get_css
|
2021-08-22 20:10:29 +02:00
|
|
|
|
2021-09-11 19:09:22 +02:00
|
|
|
|
2021-09-14 17:32:51 +02:00
|
|
|
class PublicHomepageView(TemplateView):
|
|
|
|
template_name = "common/homepage.html"
|
|
|
|
|
|
|
|
|
2021-09-07 17:05:03 +02:00
|
|
|
# @cache_page(60 * 15)
|
2021-08-22 20:10:29 +02:00
|
|
|
def debug_css(request):
|
|
|
|
css, source_map = get_css(debug=True)
|
|
|
|
return HttpResponse(css, content_type="text/css")
|
|
|
|
|
2021-09-11 19:09:22 +02:00
|
|
|
|
2021-09-07 17:05:03 +02:00
|
|
|
# @cache_page(60 * 15)
|
2021-08-22 20:10:29 +02:00
|
|
|
def debug_css_sourcemap(request):
|
|
|
|
css, source_map = get_css(debug=True)
|
|
|
|
return HttpResponse(source_map, content_type="application/json")
|
2021-09-11 19:09:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
def handler500(request, *args, **argv):
|
|
|
|
return render(request, "500.html", {
|
|
|
|
"sentry_event_id": last_event_id(),
|
|
|
|
"sentry_dsn": SENTRY_DSN
|
|
|
|
}, status=500)
|