Creating a basic signup page
The signup page has a complex functionality. We will need to consider many possible scenarios. For now, let’s implement a basic signup page. We will refactor and improve this functionality in the upcoming sections.
To implement a basic signup page, we will follow the following steps:
- Configure a signup URL.
- Define a
signup
function. - Create an accounts signup template.
- Add a signup link to the base template.
Let’s look at these steps in detail next.
Configuring a signup URL
In /accounts/
, create a new file called urls.py
. This file will contain the path relating to the URLs of the accounts app. For now, fill it in with the following code:
from django.urls import path from . import views urlpatterns = [ path('signup', views.signup, name='accounts.signup'), ]
We defined a /signup
path, but remember that the project-level URL file defined a /accounts
prefix for...