Changeset View
Changeset View
Standalone View
Standalone View
swh/web/admin/urls.py
| # Copyright (C) 2018 The Software Heritage developers | # Copyright (C) 2018-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.conf.urls import url | from django.conf.urls import url | ||||
| from django.contrib.auth.views import LoginView | from django.contrib.auth.views import LoginView | ||||
| from django.shortcuts import redirect | from django.shortcuts import redirect | ||||
| import swh.web.admin.add_forge_now # noqa | |||||
| from swh.web.admin.adminurls import AdminUrls | from swh.web.admin.adminurls import AdminUrls | ||||
| import swh.web.admin.deposit # noqa | import swh.web.admin.deposit # noqa | ||||
| import swh.web.admin.origin_save # noqa | import swh.web.admin.origin_save # noqa | ||||
| def _admin_default_view(request): | def _admin_default_view(request): | ||||
| return redirect("admin-origin-save") | return redirect("admin-origin-save") | ||||
| urlpatterns = [ | urlpatterns = [ | ||||
| url(r"^$", _admin_default_view, name="admin"), | url(r"^$", _admin_default_view, name="admin"), | ||||
| url(r"^login/$", LoginView.as_view(template_name="login.html"), name="login"), | url(r"^login/$", LoginView.as_view(template_name="login.html"), name="login"), | ||||
| ] | ] | ||||
| urlpatterns += AdminUrls.get_url_patterns() | urlpatterns += AdminUrls.get_url_patterns() |