22.2.2 Implementing ProfileDetail

Creating a public profile view is quite straightforward, so I opt to take on the stranger case first. In the case of our ProfileDetail view, shown in Example 22.5, we want to show the user’s own profile at a static (without regular expression character sets) URL: /user/profile/.

Example 22.5: Project Code

user/urls.py in de5e3e356d

 10   from .views import (  11       ActivateAccount, CreateAccount,  12       DisableAccount, ProfileDetail,  13       ResendActivationEmail)   .       ...  67   urlpatterns = [   .       ... 108       url(r'^profile/$', 109           ProfileDetail.as_view(), 110           name='profile'), 111   ]

To properly display the profile of the current User, ...

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.