February 2018
Intermediate to advanced
456 pages
9h 56m
English
Before we try this out, let's open the file settings.py in the gamestore/gamestore directory, and at the end of the file add the following setting:
LOGIN_REDIRECT_URL = '/'
This will tell Django that, after the login, the user will be redirected to "/".
Now we are ready to test the login and logout functionality, although you probably don't have any users in the database. However, we created the superuser while we were setting up our Django project, so go ahead and try logging in with that user. Run the command runserver to start the Django development server again:
python manage.py runserver
Browse to http://localhost:8000 and note that you now have the login link in the top right corner of the page:
If you ...
Read now
Unlock full access