wsvincent / djangoforprofessionals

Source code for Django for Professionals 4.0
https://djangoforprofessionals.com/
MIT License
631 stars 265 forks source link

Chapter 10: Email // Clicking on the unique URL link in the email #308

Closed machib77 closed 10 months ago

machib77 commented 10 months ago

Hi, on page 155, after I click on the unique URL link in the email it appears a 404 error:

`

Page not found (404)

Request Method: | GET -- | -- http://127.0.0.1:8000/accounts/confirm-email/NQ:1qqfkS:quBjIsocaaYVWNKNR8Y9NGb_Iu7QZlVvKyynv5J5jqM//

Using the URLconf defined in django_project.urls, Django tried these URL patterns, in this order:

  1. admin/
  2. accounts/ signup/ [name='account_signup']
  3. accounts/ login/ [name='account_login']
  4. accounts/ logout/ [name='account_logout']
  5. accounts/ reauthenticate/ [name='account_reauthenticate']
  6. accounts/ password/change/ [name='account_change_password']
  7. accounts/ password/set/ [name='account_set_password']
  8. accounts/ inactive/ [name='account_inactive']
  9. accounts/ email/ [name='account_email']
  10. accounts/ confirm-email/ [name='account_email_verification_sent']
  11. accounts/ ^confirm-email/(?P<key>[-:\w]+)/$ [name='account_confirm_email']
  12. accounts/ password/reset/ [name='account_reset_password']
  13. accounts/ password/reset/done/ [name='account_reset_password_done']
  14. accounts/ ^password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$ [name='account_reset_password_from_key']
  15. accounts/ password/reset/key/done/ [name='account_reset_password_from_key_done']
  16. about/ [name='about']
  17. [name='home']

The current path, accounts/confirm-email/NQ:1qqfkS:quBjIsocaaYVWNKNR8Y9NGb_Iu7QZlVvKyynv5J5jqM//, didn’t match any of these.

`

I made sure my code was similar to yours and I even downloaded your original code from here and I'm getting the same error.

Can you please help me?

machib77 commented 10 months ago

I figured it out the solution: The custom email_confirmation_message.txt had a bunch of \ to make it more readable on the book, but it caused a problem for {{ activate_url }}\

I removed the \ there and it worked with no problem.