summaryrefslogtreecommitdiffstats
path: root/urls.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2021-04-06 00:49:09 +0100
committerPhilip Sargent <philip.sargent@klebos.com>2021-04-06 00:49:09 +0100
commitd1cd72c5f88c581b8e446f3c92c0eb093500c60e (patch)
tree0b40a627ee461f1d03ca4b1a94e0c09d67b55e32 /urls.py
parent6d6bec35f271b5ff072a884fbfc31f5b9cb36642 (diff)
downloadtroggle-d1cd72c5f88c581b8e446f3c92c0eb093500c60e.tar.gz
troggle-d1cd72c5f88c581b8e446f3c92c0eb093500c60e.tar.bz2
troggle-d1cd72c5f88c581b8e446f3c92c0eb093500c60e.zip
New user login/logoff system using standard Dj
Diffstat (limited to 'urls.py')
-rw-r--r--urls.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/urls.py b/urls.py
index 505fa5d..90b6420 100644
--- a/urls.py
+++ b/urls.py
@@ -4,6 +4,7 @@ from django.views.generic.base import RedirectView
from django.views.generic.edit import UpdateView
from django.views.generic.list import ListView
from django.contrib import admin
+from django.contrib import auth
from django.urls import reverse, resolve
from troggle.core.views import surveys, logbooks, other, caves, statistics, survex
@@ -12,6 +13,7 @@ from troggle.core.views.caves import ent, prospecting_image, cavepage
from troggle.core.views.statistics import pathsreport, stats
from troggle.core.views.expo import expofiles_redirect, expofilessingle, expopage, editexpopage, mediapage
from troggle.core.views.survex import survexcaveslist, survexcavesingle, svx
+from troggle.core.views.auth import expologin, expologout
"""This sets the actualurlpatterns[] and urlpatterns[] lists which django uses
to resolve urls - in both directions as these are declarative.
@@ -40,6 +42,17 @@ else:
expofilesurls = [
url(r'^(?P<filepath>.*)$', expofilessingle, name="single"), # local copy of EXPOFILES
]
+
+# The URLs provided by include('django.contrib.auth.urls') are:
+
+# accounts/login/ [name='login']
+# accounts/logout/ [name='logout']
+# accounts/password_change/ [name='password_change']
+# accounts/password_change/done/ [name='password_change_done']
+# accounts/password_reset/ [name='password_reset']
+# accounts/password_reset/done/ [name='password_reset_done']
+# accounts/reset/<uidb64>/<token>/ [name='password_reset_confirm']
+# accounts/reset/done/ [name='password_reset_complete']
trogglepatterns = [
url(r'^expofiles/', include(expofilesurls)),
@@ -50,13 +63,14 @@ trogglepatterns = [
url(r'^people/?$', logbooks.personindex, name="personindex"),
url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # needs docutils Python module (http://docutils.sf.net/).
- url(r'^admin/', admin.site.urls),
+ url(r'^admin/', admin.site.urls), # includes admin login & logout urls
# setting LOGIN_URL = '/accounts/login/' is default
- #url(r'^accounts/', include('registration.backends.default.urls')), # deprecated, replace with .model_activation.urls
- url(r'^accounts/', include('registration.backends.model_activation.urls')), # deprecated in Dj3.0, but must not be commented out.
- url(r'^accounts/', include('django.contrib.auth.urls')), # from Dj3.0, see site-packages\registration\auth_urls_classes.py
-
+ # url ENDS WITH this string
+ url(r'logout/$', expologout, name='expologout'), # higher precedence than /accounts/logout
+ url(r'login/$', expologin, name='expologin'), # higher precedence than /accounts/login
+ #url(r'^accounts/', include('django.contrib.auth.urls')), # from Dj3.0, see site-packages\registration\auth_urls_classes.py
+
url(r'^newqmnumber/?$', other.ajax_QM_number, ),
# url(r'^lbo_suggestions/?$', logbook_entry_suggestions), #broken, removed.