I don't understand how would I solve this though. In something like Django one would just render the variable in the template.
The problem: browser visits twitter.com/john - or twitter.com/user/john to makes things simpler.
We should then serve a static page - say user_profile.html, which displays the static part of the user profile page and loads Javascript that will load the dynamic, user-specific part using AJAX.
Now, how would one pass the username "john", from the URL to the javascript, so we can then make the AJAX calls like get_user_tweets("john") ?