From e96c272572831d34f88db1b02711c7e40fd36cc9 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Fri, 3 Jun 2016 19:33:51 +0200 Subject: [PATCH] Add authentication app --- authentication/__init__.py | 0 authentication/apps.py | 5 +++++ authentication/migrations/__init__.py | 0 .../templates/authentication/login.html | 18 ++++++++++++++++++ authentication/urls.py | 15 +++++++++++++++ 5 files changed, 38 insertions(+) create mode 100644 authentication/__init__.py create mode 100644 authentication/apps.py create mode 100644 authentication/migrations/__init__.py create mode 100644 authentication/templates/authentication/login.html create mode 100644 authentication/urls.py diff --git a/authentication/__init__.py b/authentication/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/authentication/apps.py b/authentication/apps.py new file mode 100644 index 0000000..9635c9d --- /dev/null +++ b/authentication/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class AuthenticationConfig(AppConfig): + name = 'authentication' diff --git a/authentication/migrations/__init__.py b/authentication/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/authentication/templates/authentication/login.html b/authentication/templates/authentication/login.html new file mode 100644 index 0000000..ba2149a --- /dev/null +++ b/authentication/templates/authentication/login.html @@ -0,0 +1,18 @@ +{% extends 'base.html' %} +{% load staticfiles %} +{% load crispy_forms_filters %} + +{% block content %} +

{% block title %}Login{% endblock %}

+ +
+
+ {% if next %} + + {% endif %} + {% csrf_token %} + {{ form|crispy }} + +
+
+{% endblock %} \ No newline at end of file diff --git a/authentication/urls.py b/authentication/urls.py new file mode 100644 index 0000000..bd9a729 --- /dev/null +++ b/authentication/urls.py @@ -0,0 +1,15 @@ +from django.conf.urls import url +from django.contrib.auth.views import login, logout + +urlpatterns = [ + url(r'^login/$', + login, + {'template_name': 'authentication/login.html'}, + name='auth_login' + ), + url(r'^logout/$', + logout, + {'next_page': 'blog_home'}, + name='auth_logout' + ), +]