Changeset View
Changeset View
Standalone View
Standalone View
swh/web/browse/urls.py
# Copyright (C) 2017-2022 The Software Heritage developers | # Copyright (C) 2017-2022 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU Affero General Public License version 3, or any later version | # License: GNU Affero General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from django.http import HttpRequest, HttpResponse | from django.http import HttpRequest, HttpResponse | ||||
from django.shortcuts import redirect, render | from django.shortcuts import redirect, render | ||||
from django.urls import re_path as url | from django.urls import re_path as url | ||||
from swh.web.browse.browseurls import BrowseUrls | from swh.web.browse.browseurls import browse_urls | ||||
from swh.web.browse.identifiers import swhid_browse | from swh.web.browse.identifiers import swhid_browse | ||||
import swh.web.browse.views.content # noqa | import swh.web.browse.views.content # noqa | ||||
import swh.web.browse.views.directory # noqa | import swh.web.browse.views.directory # noqa | ||||
import swh.web.browse.views.iframe # noqa | import swh.web.browse.views.iframe # noqa | ||||
import swh.web.browse.views.origin # noqa | import swh.web.browse.views.origin # noqa | ||||
import swh.web.browse.views.release # noqa | import swh.web.browse.views.release # noqa | ||||
import swh.web.browse.views.revision # noqa | import swh.web.browse.views.revision # noqa | ||||
import swh.web.browse.views.snapshot # noqa | import swh.web.browse.views.snapshot # noqa | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | url( | ||||
swhid_browse, | swhid_browse, | ||||
name="browse-swhid-legacy", | name="browse-swhid-legacy", | ||||
), | ), | ||||
url( | url( | ||||
r"^(?P<swhid>(swh|SWH):[0-9]+:[A-Za-z]+:[0-9A-Fa-f]+.*)$", | r"^(?P<swhid>(swh|SWH):[0-9]+:[A-Za-z]+:[0-9A-Fa-f]+.*)$", | ||||
swhid_browse, | swhid_browse, | ||||
name="browse-swhid", | name="browse-swhid", | ||||
), | ), | ||||
*browse_urls.get_url_patterns(), | |||||
] | ] | ||||
urlpatterns += BrowseUrls.get_url_patterns() |