Fr3deric
6 years ago
commit
d56e124b6a
11 changed files with 98 additions and 0 deletions
@ -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,0 +1,3 @@ |
|||||||
|
from django.contrib import admin |
||||||
|
|
||||||
|
# Register your models here. |
@ -0,0 +1,5 @@ |
|||||||
|
from django.apps import AppConfig |
||||||
|
|
||||||
|
|
||||||
|
class BamConfig(AppConfig): |
||||||
|
name = 'bam' |
@ -0,0 +1,3 @@ |
|||||||
|
from django.db import models |
||||||
|
|
||||||
|
# Create your models here. |
@ -0,0 +1,8 @@ |
|||||||
|
<html> |
||||||
|
<head> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
{% block content %} |
||||||
|
{% endblock %} |
||||||
|
</body> |
||||||
|
</html> |
@ -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 %} |
@ -0,0 +1,3 @@ |
|||||||
|
from django.test import TestCase |
||||||
|
|
||||||
|
# Create your tests here. |
@ -0,0 +1,7 @@ |
|||||||
|
|
||||||
|
from django.urls import path |
||||||
|
from django.urls import include |
||||||
|
|
||||||
|
urlpatterns = [ |
||||||
|
path('accounts/', include('django.contrib.auth.urls')), |
||||||
|
] |
Loading…
Reference in new issue