21.7 URL Cleanup

Before we finish, we should take a quick look at our URL patterns. You’ll discover that we’re not fully adhering to a clean URL path policy. We have URLs with the path prefix /user/password/ but no view for the actual path. We can use a simple GCBV to fix that, as shown in Example 21.99.

Example 21.99: Project Code

user/urls.py in 541375e172

14   password_urls = [ 15       url(r'^$', 16           RedirectView.as_view( 17               pattern_name='dj-auth:pw_reset_start', 18               permanent=False)),  .       ... 64   ]

Similarly, our activation webpage uses the /activate/ URL path prefix, but we don’t have an actual page for /activate/ or even for /activate/<uidb64>/. To catch all of ...

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.