From d56e124b6a8ecf5a2097159678abc2579245b596 Mon Sep 17 00:00:00 2001 From: Frederic Date: Thu, 25 Apr 2019 20:39:13 +0200 Subject: [PATCH] initial commit --- README.md | 28 ++++++++++++++++++++ bam/__init__.py | 0 bam/admin.py | 3 +++ bam/apps.py | 5 ++++ bam/migrations/__init__.py | 0 bam/models.py | 3 +++ bam/templates/base.html | 8 ++++++ bam/templates/registration/login.html | 38 +++++++++++++++++++++++++++ bam/tests.py | 3 +++ bam/urls.py | 7 +++++ bam/views.py | 3 +++ 11 files changed, 98 insertions(+) create mode 100644 README.md create mode 100644 bam/__init__.py create mode 100644 bam/admin.py create mode 100644 bam/apps.py create mode 100644 bam/migrations/__init__.py create mode 100644 bam/models.py create mode 100644 bam/templates/base.html create mode 100644 bam/templates/registration/login.html create mode 100644 bam/tests.py create mode 100644 bam/urls.py create mode 100644 bam/views.py diff --git a/README.md b/README.md new file mode 100644 index 0000000..d539150 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# bam - Blinkenbunt Account Manager + +## Installation + +Follow these steps to initialize a development environment: + + 1. Initialize _Django_ project + ``` + django startproject PROJECT_NAME + ``` + 2. Add `bam` to `INSTALLED_APPS` in the project's `settings.py` + 3. Append `path('', include('bam.urls')),` to the project's `urls.py` + 4. Initialize database + ``` + ./manage.py migrate + ``` + +## ToDo + +### Essential + + * LDAP sync mangement command + * profile page view to be displayed after login + * unify CSS for custom views and auth view + +### Optional, planned + + * service-based logins diff --git a/bam/__init__.py b/bam/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bam/admin.py b/bam/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/bam/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/bam/apps.py b/bam/apps.py new file mode 100644 index 0000000..0c2403a --- /dev/null +++ b/bam/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class BamConfig(AppConfig): + name = 'bam' diff --git a/bam/migrations/__init__.py b/bam/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/bam/models.py b/bam/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/bam/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/bam/templates/base.html b/bam/templates/base.html new file mode 100644 index 0000000..ab807ba --- /dev/null +++ b/bam/templates/base.html @@ -0,0 +1,8 @@ + + + + +{% block content %} +{% endblock %} + + diff --git a/bam/templates/registration/login.html b/bam/templates/registration/login.html new file mode 100644 index 0000000..dce5873 --- /dev/null +++ b/bam/templates/registration/login.html @@ -0,0 +1,38 @@ +{% extends "base.html" %} + +{% block content %} + +{% if form.errors %} +

Your username and password didn't match. Please try again.

+{% endif %} + +{% if next %} + {% if user.is_authenticated %} +

Your account doesn't have access to this page. To proceed, + please login with an account that has access.

+ {% else %} +

Please login to see this page.

+ {% endif %} +{% endif %} + +
+{% csrf_token %} + + + + + + + + + +
{{ form.username.label_tag }}{{ form.username }}
{{ form.password.label_tag }}{{ form.password }}
+ + + +
+ +{# Assumes you setup the password_reset view in your URLconf #} +

Lost password?

+ +{% endblock %} diff --git a/bam/tests.py b/bam/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/bam/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/bam/urls.py b/bam/urls.py new file mode 100644 index 0000000..2c12378 --- /dev/null +++ b/bam/urls.py @@ -0,0 +1,7 @@ + +from django.urls import path +from django.urls import include + +urlpatterns = [ + path('accounts/', include('django.contrib.auth.urls')), +] diff --git a/bam/views.py b/bam/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/bam/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.