<form method="POST" action="{% url user.login %}" class="user login">
  <input type="hidden" name="previous_page"  value="{% if app == "user" %}{{ previous_page }}{% else %}{{ current_page }}{% endif %}">

  {{ form.nick.errors }}
  <p class="nick">
    {{ form.nick.label_tag }}
    {{ form.nick }}
  </p>
  {{ form.password.errors }}
  <p class="password">
    {{ form.password.label_tag }}
    {{ form.password }}
  </p>

  <p class="buttons center last">
    <input type="submit" value="{% translate "Login" %}">
    <a href="{{ previous_page }}">{% translate "Cancel" %}</a>
  </p>
</form>