Browse Source

initial commit

master
Fr3deric 5 years ago
commit
d56e124b6a
  1. 28
      README.md
  2. 0
      bam/__init__.py
  3. 3
      bam/admin.py
  4. 5
      bam/apps.py
  5. 0
      bam/migrations/__init__.py
  6. 3
      bam/models.py
  7. 8
      bam/templates/base.html
  8. 38
      bam/templates/registration/login.html
  9. 3
      bam/tests.py
  10. 7
      bam/urls.py
  11. 3
      bam/views.py

28
README.md

@ -0,0 +1,28 @@ @@ -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

0
bam/__init__.py

3
bam/admin.py

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
bam/apps.py

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
from django.apps import AppConfig
class BamConfig(AppConfig):
name = 'bam'

0
bam/migrations/__init__.py

3
bam/models.py

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

8
bam/templates/base.html

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
<html>
<head>
</head>
<body>
{% block content %}
{% endblock %}
</body>
</html>

38
bam/templates/registration/login.html

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
{% extends "base.html" %}
{% block content %}
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
{% if next %}
{% if user.is_authenticated %}
<p>Your account doesn't have access to this page. To proceed,
please login with an account that has access.</p>
{% else %}
<p>Please login to see this page.</p>
{% endif %}
{% endif %}
<form method="post" action="{% url 'login' %}">
{% csrf_token %}
<table>
<tr>
<td>{{ form.username.label_tag }}</td>
<td>{{ form.username }}</td>
</tr>
<tr>
<td>{{ form.password.label_tag }}</td>
<td>{{ form.password }}</td>
</tr>
</table>
<input type="submit" value="login">
<input type="hidden" name="next" value="{{ next }}">
</form>
{# Assumes you setup the password_reset view in your URLconf #}
<p><a href="{% url 'password_reset' %}">Lost password?</a></p>
{% endblock %}

3
bam/tests.py

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

7
bam/urls.py

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
from django.urls import path
from django.urls import include
urlpatterns = [
path('accounts/', include('django.contrib.auth.urls')),
]

3
bam/views.py

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.
Loading…
Cancel
Save