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' + ), +]