cclerv
cclerv

Reputation: 2969

cannot concatenate 'str' and 'WSGIRequest' objects

I keep getting this error when I try to load my templates:

TypeError: cannot concatenate 'str' and 'WSGIRequest' objects

Here is a link to the paste: https://gist.github.com/3b7039baf13d91a67de2

You will notice that one of the lines from the traceback points to my views.py and the last line in the method below. Could this last line be the problem and if so how can I go about fixing it. Thanks in advance

def all(request):
    """This returns all the photos in the database
    """
    return render_to_response(request, 'photos/all.html', {'photos':
        Photo.objects.all().order_by('-date_added')})

Upvotes: 0

Views: 915

Answers (1)

Brandon Taylor
Brandon Taylor

Reputation: 34603

render_to_response doesn't accept request as its first argument.

render, from Django 1.3, however does. Perhaps that the method you intended to use?

Upvotes: 2

Related Questions