updated show_msg method to also use the user variable in the context.
{% extends 'base.html' %}
{% block content %}
{% if error_msg %}
{{ error_msg }}<br />
{% endif %}
<form action="" method="post">
{{form.as_p}}
<input type="submit" value="Submit">
</form>
{% endblock %}