I'm having some trouble trying to pass a string from a URL to the views. My page has user pages, and if you go to site.com/username it brings up that users page. But when I try going it says this: [invalid literal for int() with base 10: 'username'].
Here's my code:
urls.py:
(r'^user/(?P<userName>[^/]+)/$', 'mischief_blog.mischief_app.views.user_view'),
views.py:
def user_view(request, userName):
postList = userPost.objects.filter(author=userName)
return render_to_response('user.html', {"user": user_name, "postList": postList}, context_instance=RequestContext(request))