Add example project
This commit is contained in:
parent
916b08374a
commit
9449481bd4
16 changed files with 525 additions and 0 deletions
88
example/app/templates/app/home.html
Normal file
88
example/app/templates/app/home.html
Normal file
|
@ -0,0 +1,88 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="uft-8">
|
||||
<title>Test app authens</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial;
|
||||
}
|
||||
|
||||
a {
|
||||
color: blue;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover, a:focus {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{% if messages %}
|
||||
|
||||
<h2>Messages</h2>
|
||||
|
||||
<ul>
|
||||
{% for message in messages %}
|
||||
<li>{{ message.level_tag|upper }} - {{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
<h2>Utilisateur connecté</h2>
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
Connecté avec <b>{{ user }}</b> (superuser: <b>{{ user.is_superuser|yesno:"oui,non" }}</b>)
|
||||
{% else %}
|
||||
Non connecté
|
||||
{% endif %}
|
||||
|
||||
<h3>Pages comptes</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="{% url "account_signup" %}">Inscription</a></li>
|
||||
</ul>
|
||||
|
||||
<p>Les pages suivantes nécessitent d'être connecté pour y accéder.</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="{% url "account_settings" %}">Paramètres</a></li>
|
||||
<li><a href="{% url "account_change_password" %}">Modifier le mot de passe</a></li>
|
||||
<li><a href="{% url "account_email" %}">Emails</a></li>
|
||||
<li><a href="{% url "socialaccount_connections" %}">Connexions par tiers</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Navigation</h2>
|
||||
|
||||
|
||||
<h3>Accéder à une page</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="{% url "view" %}"><tt>/view/</tt> : non protégée</a></li>
|
||||
<li><a href="{% url "user-view" %}"><tt>/user/</tt> : authentification requise</a></li>
|
||||
<li><a href="{% url "root-view" %}"><tt>/root/</tt> : super-utilisateurs seulement</a></li>
|
||||
<li><a href="{% url "admin:index" %}"><tt>/admin/</tt></a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Connexion (<tt>/accounts/login/(?next=<redirect>)?</tt>)</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="{% url "account_login" %}">Sans redirection</a></li>
|
||||
<li><a href="{% url "account_login" %}?next=/view/">Redirection: /view/</a></li>
|
||||
<li><a href="{% url "account_login" %}?next=/user/">Redirection: /user/</a></li>
|
||||
<li><a href="{% url "account_login" %}?next=/root/">Redirection: /root/</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Déconnexion (<tt>/accounts/logout/(?next=<redirect>)?</tt>)</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="{% url "account_logout" %}">Sans redirection</a></li>
|
||||
<li><a href="{% url "account_logout" %}?next=/view/">Redirection: /view/</a></li>
|
||||
<li><a href="{% url "account_logout" %}?next=/user/">Redirection: /user/</a></li>
|
||||
<li><a href="{% url "account_logout" %}?next=/root/">Redirection: /root/</a></li>
|
||||
</ul>
|
Loading…
Add table
Add a link
Reference in a new issue