From c543d64726a224f6837fb9a24690ce3341e2a85f Mon Sep 17 00:00:00 2001 From: Seth Ladygo Date: Tue, 12 Mar 2019 17:36:40 -0700 Subject: [PATCH] add stub login page --- procat2/settings.py | 5 +++++ procat2/urls.py | 12 +++++++++++- templates/base.html | 22 ++++++++++++++++++++++ templates/registration/login.html | 12 ++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 templates/base.html create mode 100644 templates/registration/login.html diff --git a/procat2/settings.py b/procat2/settings.py index 2983662..9850495 100644 --- a/procat2/settings.py +++ b/procat2/settings.py @@ -78,6 +78,9 @@ DATABASES = { } } +AUTHENTICATION_BACKENDS = ( + 'django.contrib.auth.backends.ModelBackend', +) # Password validation # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators @@ -117,4 +120,6 @@ USE_TZ = True STATIC_URL = '/static/' +LOGIN_REDIRECT_URL = '/' + from .settings_ansible import * diff --git a/procat2/urls.py b/procat2/urls.py index c7b6eb7..26a3f31 100644 --- a/procat2/urls.py +++ b/procat2/urls.py @@ -14,8 +14,18 @@ Including another URLconf 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin -from django.urls import path +from django.urls import include, path urlpatterns = [ path('admin/', admin.site.urls), + path('accounts/', include('django.contrib.auth.urls')), ] + +# 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/// [name='password_reset_confirm'] +# accounts/reset/done/ [name='password_reset_complete'] diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..4940e00 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,22 @@ +{% load staticfiles %} + + + + + + TITLE + + + + {% block navigation %} + + {% endblock%} + + {% block content %} + {% endblock %} + + + + diff --git a/templates/registration/login.html b/templates/registration/login.html new file mode 100644 index 0000000..e2355d2 --- /dev/null +++ b/templates/registration/login.html @@ -0,0 +1,12 @@ +{% extends 'base.html' %} + +{% block title %}Login{% endblock %} + +{% block content %} +

Login

+
+ {% csrf_token %} + {{ form.as_p }} + +
+{% endblock %}