KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
This is my code: from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django import http from django.http import HttpResponse def main(request, template_name='index.html'): HttpResponse.set_cookie('logged_in_status', 'zjm1126') context ={ 'a':a, 'cookie':HttpResponse.get_cookie('logged_in_status'), } return render_to_response(template_name, context) #return http.HttpResponsePermanentRedirect(template_name) It raises this exception: unbound method set_cookie() must be called with HttpResponse instance as first argument (got str instance instead) What can I do?
Tags (comma-separated)
Save Edits
Cancel