62 lines
1.8 KiB
Python
62 lines
1.8 KiB
Python
from django.contrib import admin
|
|
from django.urls import path
|
|
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from django.contrib.auth.views import LogoutView
|
|
|
|
from core import views
|
|
|
|
urlpatterns = [
|
|
# Admin
|
|
path("admin/", admin.site.urls),
|
|
|
|
# Home/Search
|
|
path("", views.search_page), # root lands on search (no name on purpose)
|
|
path("search/", views.search_page, name="search"),
|
|
|
|
# Auth
|
|
path("login/", views.login_view, name="login"),
|
|
path(
|
|
"logout/",
|
|
LogoutView.as_view(next_page=settings.LOGOUT_REDIRECT_URL),
|
|
name="logout",
|
|
),
|
|
|
|
# Navigation within a search result set
|
|
path("nav/next/", views.nav_next, name="nav_next"),
|
|
path("nav/prev/", views.nav_prev, name="nav_prev"),
|
|
|
|
# Entries
|
|
path("entry/new/", views.entry_add, name="entry_add"),
|
|
path("entry/<int:entry_id>/", views.entry_view, name="entry_view"),
|
|
path("entry/<int:entry_id>/edit/", views.entry_edit, name="entry_edit"),
|
|
path("entry/<int:entry_id>/delete/", views.entry_delete, name="entry_delete"),
|
|
|
|
# Stats
|
|
path("stats/", views.stats_page, name="stats"),
|
|
|
|
# Import/Export
|
|
path("export/", views.export_csv, name="export_csv"),
|
|
path("import/", views.import_wizard, name="import_wizard"),
|
|
|
|
# Tools / Normalizers
|
|
path(
|
|
"tools/normalize-scripture/",
|
|
views.normalize_scripture,
|
|
name="normalize_scripture",
|
|
),
|
|
path(
|
|
"tools/normalize-source/",
|
|
views.normalize_source,
|
|
name="normalize_source",
|
|
),
|
|
path(
|
|
"tools/normalize-subjects/",
|
|
views.normalize_subjects,
|
|
name="normalize_subjects",
|
|
),
|
|
]
|
|
|
|
# Serve static files in DEBUG (e.g., for local dev)
|
|
if settings.DEBUG:
|
|
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) |