Creating the orders page
Let’s finalize our Movies Store by allowing users to see their orders. To achieve that, we need to follow these steps:
- Configuring the orders URL.
- Defining the
orders
function. - Creating the
accounts.orders
template. - Adding a link to the base template.
Configuring the orders URL
An order belongs to a specific user. Because of this, we will add the orders functionality inside the accounts
app. In /accounts/urls.py
, add the next path in bold:
from django.urls import path from . import views urlpatterns = [ path('signup', views.signup, name='accounts.signup'), path('login/', views.login, name='accounts.login'), path('logout/', views.logout, name='accounts.logout'), path('orders/', views.orders, name='accounts.orders'), ]
We defined an accounts/orders...