Well, this is clearly not the case, because the URL you created does not match your URL.
The right way to do this is to rely on Django to do it for you. If you provide your URL definition:
urlpatterns += patterns('',
url(r'^profile/(?P\d+)/$', ' ...', name='profile'),
)
then you can use django.core.urlresolvers.reverseto create this URL with your arguments:
redirect_url = reverse('profile', args=[user.id])
return HttpResponseRedirect(redirect_url)
, kwarg, args URL-, , .