41. My account page
{% extends 'base.html' %}
{% load static %}
{% block body %}
<h3>
Your account
</h3>
<a href="{% url 'my_orders' %}">My orders</a>
<a href="{% url 'perform_logout' %}">Logout</a>
<h3>Account information</h3>
<form method="POST" action="{%url 'your_account' %}">
{% csrf_token %}
<input type="text" name="name" placeholder="Full Name"
{% if request.user.client.name %}
value="{{ request.user.client.name }}"
{% endif %}>
<input type="email" name="email" placeholder="Email" value="{{ request.user.email }}"> <!--Initializing the textbox with the users email (all users have a email associated)-->
<input type="number" name="name" placeholder="Telephone" value="{{ request.user.client.phone }}">
<button type="submit">Save</button>
</form>
<hr>
<h3>Change Password</h3>
<form method="POST" action="{% url 'your_account' %}">
{% csrf_token %}
<input type="password" name="current_password" placeholder="Current Password">
<input type="password" name="new_password" placeholder="New Password">
<input type="password" name="confirm_new_password" placeholder="Confirm new password">
<button type="submit">Change Password</button>
</form>
{% endblock %}
Last updated