[Fixed]-NoReverseMatch in Django; views and urls are properly defined

1👍

What is the valid characters in the Post.uid? Your question has two examples u'CHacFvE_' from the error message and {u'uid': u'-lTmOw__'} in the stack trace.

If you want both underscores and dashes to be valid in uid, you must change the regex.

^posts/(?P<uid>[-\w]+)$

explanation: https://regex101.com/r/1E2WVY/1

0👍

Your pattern is wrong, try this:

'^posts/(?P<uid>\w+)$'
👤Xiao

Leave a comment