Changeset View
Changeset View
Standalone View
Standalone View
swh/web/webapp/urls.py
Show All 10 Lines | |||||
from django.http import JsonResponse | from django.http import JsonResponse | ||||
from django.shortcuts import render | from django.shortcuts import render | ||||
from django.templatetags.static import static | from django.templatetags.static import static | ||||
from django.urls import re_path as url | from django.urls import re_path as url | ||||
from django.views.generic.base import RedirectView | from django.views.generic.base import RedirectView | ||||
from swh.web.config import get_config | from swh.web.config import get_config | ||||
from swh.web.utils import archive, origin_visit_types | from swh.web.utils import archive, is_swh_web_production, origin_visit_types | ||||
from swh.web.utils.exc import sentry_capture_exception | from swh.web.utils.exc import sentry_capture_exception | ||||
swh_web_config = get_config() | swh_web_config = get_config() | ||||
SWH_FAVICON = "img/icons/swh-logo-32x32.png" | SWH_FAVICON = "img/icons/swh-logo-32x32.png" | ||||
favicon_view = RedirectView.as_view(url=static(SWH_FAVICON), permanent=True) | favicon_view = RedirectView.as_view(url=static(SWH_FAVICON), permanent=True) | ||||
logger = logging.getLogger(__name__) | logger = logging.getLogger(__name__) | ||||
def default_view(request): | def default_view(request): | ||||
return render(request, "homepage.html", {"visit_types": origin_visit_types()}) | return render( | ||||
request, | |||||
"homepage.html", | |||||
{"visit_types": origin_visit_types(use_cache=is_swh_web_production(request))}, | |||||
) | |||||
def stat_counters(request): | def stat_counters(request): | ||||
stat_counters = archive.stat_counters() | stat_counters = archive.stat_counters() | ||||
url = get_config()["history_counters_url"] | url = get_config()["history_counters_url"] | ||||
stat_counters_history = {} | stat_counters_history = {} | ||||
try: | try: | ||||
Show All 19 Lines |