django-friendship
django-friendship copied to clipboard
NoReverseMatch at /account/friendship/users/ Reverse for 'friendship_add_friend' not found.
I added the path('friendship/', include('friendship.urls')),
in my app's url and then when I go to the url
friendship/users/
it gives me this error
NoReverseMatch at /account/friendship/users/ Reverse for 'friendship_add_friend' not found. 'friendship_add_friend' is not a valid view function or pattern name.
I didn't write any views just an add path inurls.py
in my app
I think this happens because your username probably has characters other than a-z or A-Z. I hit this same problem because my username contains a period/full stop (e.g. "."). It's definitely a bug in this module.
#144 might help on a few edge cases.
I think this happens because your username probably has characters other than a-z or A-Z. I hit this same problem because my username contains a period/full stop (e.g. "."). It's definitely a bug in this module.
This is the case for me.
What's a quick fix to this?
Yeah it looks to be from the slugification of the username.
The easiest thing to do would be to write your own views that used the PK of your User model rather than the username. Would just be a matter of duplicating the included views and adjusting just a little bit. (i.e. User.objects.get(pk=pk) vs
User.objects.get(username=username)`