diff options
| author | tom christie tom@tomchristie.com | 2011-01-27 21:19:25 +0000 |
|---|---|---|
| committer | tom christie tom@tomchristie.com | 2011-01-27 21:19:25 +0000 |
| commit | e9168b508b38b545406089c8592342e5eb70f9f9 (patch) | |
| tree | eca0ff410c21374a6e055be1c71bd671e640a4ed /examples | |
| parent | 216baa551fdce6394aa640ee0806c79b38658daf (diff) | |
| download | django-rest-framework-e9168b508b38b545406089c8592342e5eb70f9f9.tar.bz2 | |
Login/Logout and FlyWheel API link in HTML emitter - Add templates, quote next value, only use login/logout if settings.LOGIN_URL and settings.LOGOUT_URL are in urlconf
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/templates/base.html | 7 | ||||
| -rw-r--r-- | examples/templates/registration/login.html | 26 |
2 files changed, 33 insertions, 0 deletions
diff --git a/examples/templates/base.html b/examples/templates/base.html new file mode 100644 index 00000000..1ff37dab --- /dev/null +++ b/examples/templates/base.html @@ -0,0 +1,7 @@ +<html> + <head> + </head> + <body> +{% block content %}{% endblock %} + </body> +</html>
\ No newline at end of file diff --git a/examples/templates/registration/login.html b/examples/templates/registration/login.html new file mode 100644 index 00000000..9d0b481b --- /dev/null +++ b/examples/templates/registration/login.html @@ -0,0 +1,26 @@ +{% extends "base.html" %} + +{% block content %} + +{% if form.errors %} +<p>Your username and password didn't match. Please try again.</p> +{% endif %} + +<form method="post" action="{% url django.contrib.auth.views.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> + +{% endblock %}
\ No newline at end of file |
