[Django]-Django raising Type Error "profile() got an unexpected keyword argument 'user'"

2👍

Your problem is that your url pattern is passing an argument user, but your view method is defining the argument as id.

url(r'^profile/(?P<user>\d+)$', views.profile, name="profile"),
                   ^^^^

Your view method, however:

@verified_email_required()
def profile(request, id):
                     ^^

0👍

It’s just a name issue. In the URL for profile you are capturing a “user” variable. But the view itself is expecting an “id” argument. Make these consistent.

Leave a comment