In a django app, I need to create twitter user profile urls with following structure like:
example.com/
example.com
I don't see why your URLs aren't working. You can try moving the first pattern to the end, so that other patterns have a chance to match first. The problem you're describing sounds like example.com/user/any-page
, the pattern is matching "user/any-page" as the account name. The regex you show wouldn't do that, but maybe your actual code is slightly different?