We now have user authentication via the web interface. @whee.
This commit is contained in:
parent
be4e0069a6
commit
2e397df4d5
4 changed files with 56 additions and 5 deletions
6
urls.py
6
urls.py
|
|
@ -10,12 +10,16 @@ from django.conf.urls.defaults import *
|
||||||
import settings
|
import settings
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
|
# User Authentication
|
||||||
|
(r'^accounts/login', 'django.contrib.auth.views.login'),
|
||||||
|
(r'^accounts/logout', 'django.contrib.auth.views.logout'),
|
||||||
|
|
||||||
# Admin interface
|
# Admin interface
|
||||||
(r'^admin/', include('django.contrib.admin.urls')),
|
(r'^admin/', include('django.contrib.admin.urls')),
|
||||||
|
|
||||||
# Front page
|
# Front page
|
||||||
(r'^', include('apps.website.urls')),
|
(r'^', include('apps.website.urls')),
|
||||||
|
|
||||||
# News stuff
|
# News stuff
|
||||||
(r'^news/', include('apps.news.urls')),
|
(r'^news/', include('apps.news.urls')),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
{% block header_ext %}
|
{% block header_ext %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
<title>{{game_name}} - {% if flatpage %}{{flatpage.title}}{% else %}{{page_title}}{% endif %}</title>
|
<title>{{game_name}} - {% if flatpage %}{{flatpage.title}}{% else %}{% block titleblock %}{{page_title}}{% endblock %}{% endif %}</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -45,9 +45,15 @@
|
||||||
|
|
||||||
<div class="headerLinks">
|
<div class="headerLinks">
|
||||||
<span class="doNotDisplay">Tools:</span>
|
<span class="doNotDisplay">Tools:</span>
|
||||||
<a href="/tbi">Log In «</a>
|
{% if user.is_authenticated %}
|
||||||
<span class="doNotDisplay">|</span>
|
<a href="/accounts/logout/">Log Out «</a>
|
||||||
<a href="/tbi">Register «</a>
|
<span class="doNotDisplay">|</span>
|
||||||
|
Logged in as {{user.username}} «
|
||||||
|
{% else %}
|
||||||
|
<a href="/accounts/login/">Log In «</a>
|
||||||
|
<span class="doNotDisplay">|</span>
|
||||||
|
<a href="/tbi">Register «</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
10
webtemplates/prosimii/registration/logged_out.html
Normal file
10
webtemplates/prosimii/registration/logged_out.html
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block titleblock %}
|
||||||
|
Logged Out
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1 id="alt-layout">Logged Out</h1>
|
||||||
|
<p>You have been logged out.</p>
|
||||||
|
{% endblock %}
|
||||||
31
webtemplates/prosimii/registration/login.html
Normal file
31
webtemplates/prosimii/registration/login.html
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block titleblock %}
|
||||||
|
Login
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1 id="alt-layout">Login</h1>
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
<p>You are already logged in!</p>
|
||||||
|
{% else %}
|
||||||
|
{% if form.has_errors %}
|
||||||
|
<p>Your username and password didn't match. Please try again.</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<form method="post" action=".">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td><label for="id_username">Username:</label></td>
|
||||||
|
<td>{{ form.username }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for="id_password">Password:</label></td>
|
||||||
|
<td>{{ form.password }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<input type="submit" value="Login" />
|
||||||
|
<input type="hidden" name="next" value="{{ next }}" />
|
||||||
|
</form>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue