Creating an accounts app
The complete user authentication system involves a set of functionalities such as a signup, a login, a logout, and some validations. None of these functionalities seem to belong to our home app or movies app, so let’s separate them inside a new app. This new app will be called accounts
.
We will follow these steps to create and configure the new app:
- Create an accounts app.
- Add the accounts app to the settings file.
- Include an accounts URL file in the project-level URL file.
Let’s go through each of these steps in detail in the next few sections.
Creating an accounts app
Navigate to the top moviesstore
folder (the one that contains the manage.py
file) and run the following in the terminal:
- For macOS, run the following command:
python3 manage.py startapp accounts
- For Windows, run the following command:
python manage.py startapp accounts
Figure 8.1 shows the new project structure. Verify that it matches...