Basic auth system

This commit is contained in:
Skia
2015-11-18 17:09:06 +01:00
parent 5bd40b2ec4
commit 619e27eb52
11 changed files with 232 additions and 57 deletions

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<link rel="stylesheet" href="style.css" />
<title>{% block title %}Bienvenue sur le Sith de l'AE!{% endblock %}</title>
</head>
<body>
<header>
{% block header %}
{% if user %}Hello, {{ user.username }}!{% endif %}
<ul>
<li><a href="{% url 'core:register' %}">Register</a></li>
<li><a href="{% url 'core:login' %}">Login</a></li>
<li><a href="{% url 'core:logout' %}">Logout</a></li>
</ul>
{% endblock %}
</header>
<div id="content">
{% block content %}{% endblock %}
</div>
<footer>
{% block footer %}
Site réalisé par des gens biens
{% endblock %}
</footer>
</body>
</html>

View File

@ -0,0 +1 @@
{% extends "sith/base.html" %}

View File

@ -0,0 +1,14 @@
{% extends "core/base.html" %}
{% block title %}{{ title }}{% endblock %}
{% block content %}
<h1>{{ title }}</h1>
<form action="{% url 'core:login' %}" method="post">
{% csrf_token %}
{{ form }}
<p><input type="submit" value="Login!" /></p>
</form>
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends "core/base.html" %}
{% block title %}{{ title }}{% endblock %}
{% block content %}
<h1>{{ title }}</h1>
<form action="{% url 'core:register' %}" method="post">
{% csrf_token %}
{{ form }}
<p><input type="submit" value="Register!" /></p>
</form>
{% endblock %}

View File

@ -1,13 +0,0 @@
<h1>Register a user</h1>
{% if username %}
You registered successfully, {{ username }}!
{% endif %}
<form action="{% url 'sith:register' %}" method="post">
{% csrf_token %}
<ul>
{{ form }}
<li><input type="submit" value="Register!" /></li>
</ul>
</form>