lib.itmens/boofilsic/urls.py

59 lines
2.1 KiB
Python
Raw Normal View History

2020-05-01 22:46:15 +08:00
"""boofilsic URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from users.views import login
2023-02-15 15:45:57 -05:00
from common.api import api
2023-07-04 17:21:17 -04:00
from django.views.generic import RedirectView
2020-05-01 22:46:15 +08:00
urlpatterns = [
2023-06-22 08:00:50 -04:00
path("api/", api.urls), # type: ignore
2023-01-02 00:03:13 -05:00
path("login/", login),
path("markdownx/", include("markdownx.urls")),
2023-07-04 17:21:17 -04:00
path("account/", include("users.urls")),
path(
"users/connect/",
RedirectView.as_view(url="/account/connect", query_string=True),
),
path(
"users/OAuth2_login/",
RedirectView.as_view(url="/account/login/oauth", query_string=True),
),
2023-01-02 00:03:13 -05:00
path("", include("catalog.urls")),
path("", include("journal.urls")),
2023-01-09 00:09:45 -05:00
path("timeline/", include("social.urls")),
2023-01-02 00:03:13 -05:00
path("announcement/", include("management.urls")),
path("hijack/", include("hijack.urls")),
path("", include("common.urls")),
2023-01-08 23:17:30 -05:00
path("", include("legacy.urls")),
2023-06-27 23:11:20 -04:00
path("", include("developer.urls")),
# path("oauth/", include("oauth2_provider.urls", namespace="oauth2_provider")),
2023-01-10 22:36:13 -05:00
path("tz_detect/", include("tz_detect.urls")),
2023-02-04 10:56:14 -05:00
path(settings.ADMIN_URL + "/", admin.site.urls),
path(settings.ADMIN_URL + "-rq/", include("django_rq.urls")),
2020-05-01 22:46:15 +08:00
]
2021-02-15 21:27:50 +01:00
if settings.DEBUG:
from django.conf.urls.static import static
2023-01-02 00:03:13 -05:00
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
2023-02-04 00:45:17 -05:00
handler400 = "common.views.error_400"
handler403 = "common.views.error_403"
handler404 = "common.views.error_404"
handler500 = "common.views.error_500"