views:

42

answers:

1

I didn't expect this to occur [since I didn't know when django changed to allow _ and . in usernames], but when I attempt {% url feed_user entry.username %}

I will get a 500 error when the username contains a '.' In this case rob.e as a username will fail.

Any ideas how to deal with this?

+4  A: 

The problem will be in whatever regex you are using in your urls.py to match feed_user. Presumably you are using something like r'(?P<username>\w+)/$', which only matches on alphanumeric characters and doesn't match on punctuation.

Instead, use this: r'(?P<username>[\w.]+)/$'

Daniel Roseman
This fixed it! Totally didn't think about that. Thanks Daniel