2017-08-13 21:06:11 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2017-11-18 09:22:12 +00:00
|
|
|
from django.conf.urls.static import static
|
|
|
|
from django.conf import settings
|
2017-08-11 18:32:02 +00:00
|
|
|
from django.contrib import admin
|
2017-11-09 12:24:32 +00:00
|
|
|
from django.contrib.auth import views as auth_views
|
2022-07-30 21:22:34 +00:00
|
|
|
from django.urls import include, path, reverse_lazy
|
2017-11-09 12:24:32 +00:00
|
|
|
|
|
|
|
from . import views
|
2017-08-11 18:32:02 +00:00
|
|
|
|
2017-12-03 22:00:51 +00:00
|
|
|
app_patterns = [
|
2022-02-10 00:00:30 +00:00
|
|
|
path("login/", auth_views.LoginView.as_view(), name="login"),
|
|
|
|
path("logout/", views.LogoutView.as_view(), name="logout"),
|
2017-12-13 23:12:32 +00:00
|
|
|
path(
|
2022-07-30 21:22:34 +00:00
|
|
|
"reset/",
|
|
|
|
auth_views.PasswordResetView.as_view(
|
|
|
|
success_url=reverse_lazy("babybuddy:password_reset_done")
|
|
|
|
),
|
|
|
|
name="password_reset",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"reset/<uidb64>/<token>/",
|
|
|
|
auth_views.PasswordResetConfirmView.as_view(
|
|
|
|
success_url=reverse_lazy("babybuddy:password_reset_complete")
|
|
|
|
),
|
|
|
|
name="password_reset_confirm",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"reset/done/",
|
|
|
|
auth_views.PasswordResetDoneView.as_view(),
|
|
|
|
name="password_reset_done",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"reset/complete/",
|
|
|
|
auth_views.PasswordResetCompleteView.as_view(),
|
|
|
|
name="password_reset_complete",
|
2017-12-13 23:12:32 +00:00
|
|
|
),
|
2022-02-10 00:00:30 +00:00
|
|
|
path("", views.RootRouter.as_view(), name="root-router"),
|
|
|
|
path("welcome/", views.Welcome.as_view(), name="welcome"),
|
|
|
|
path("users/", views.UserList.as_view(), name="user-list"),
|
|
|
|
path("users/add/", views.UserAdd.as_view(), name="user-add"),
|
|
|
|
path("users/<int:pk>/edit/", views.UserUpdate.as_view(), name="user-update"),
|
2023-02-11 17:02:23 +00:00
|
|
|
path("users/<int:pk>/unlock/", views.UserUnlock.as_view(), name="user-unlock"),
|
2022-02-10 00:00:30 +00:00
|
|
|
path("users/<int:pk>/delete/", views.UserDelete.as_view(), name="user-delete"),
|
|
|
|
path("user/password/", views.UserPassword.as_view(), name="user-password"),
|
|
|
|
path("user/settings/", views.UserSettings.as_view(), name="user-settings"),
|
2022-10-17 07:40:06 +00:00
|
|
|
path("user/add-device/", views.UserAddDevice.as_view(), name="user-add-device"),
|
2023-04-15 20:59:44 +00:00
|
|
|
path("settings/", include("dbsettings.urls")),
|
2017-12-03 21:52:27 +00:00
|
|
|
]
|
2017-11-09 12:24:32 +00:00
|
|
|
|
2017-12-03 21:52:27 +00:00
|
|
|
urlpatterns = [
|
2022-02-10 00:00:30 +00:00
|
|
|
path("admin/", admin.site.urls),
|
|
|
|
path("", include("api.urls", namespace="api")),
|
|
|
|
path("", include((app_patterns, "babybuddy"), namespace="babybuddy")),
|
|
|
|
path("user/lang", include("django.conf.urls.i18n")),
|
|
|
|
path("", include("core.urls", namespace="core")),
|
|
|
|
path("", include("dashboard.urls", namespace="dashboard")),
|
|
|
|
path("", include("reports.urls", namespace="reports")),
|
2017-08-11 18:32:02 +00:00
|
|
|
]
|
2017-11-18 09:22:12 +00:00
|
|
|
|
2017-12-02 21:20:15 +00:00
|
|
|
if settings.DEBUG: # pragma: no cover
|
2022-02-10 00:00:30 +00:00
|
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|