19.5.2 Creating a User App

Now that we understand the User model, we turn our attention to creating a login and logout webpage. We know that the auth app supplies a full URL configuration, and we could start by trying to use these URLs for our own site, as shown in Example 19.24.

Example 19.24: Project Code

suorganizer/urls.py in 8c2972bf62

18   from django.contrib.auth import urls as auth_urls  .       ... 27   urlpatterns = [  .       ... 41       url(r'^user/', include(auth_urls)), 42   ]

You might imagine that we now create a template for when the user logs out. By default, the logout() view displays this logout-success page at registration/logged_out.html, as shown in Example 19.25.

Example 19.25: Project ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.