Opened 8 years ago

Closed 8 years ago

#26072 closed Uncategorized (invalid)

Errno 10053 occured when use login_required view with ajax

Reported by: JunLuo Owned by: nobody
Component: contrib.auth Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


   url(r'realtime_index$',views.get_realtime_index, name='realtime_index'),


			data : {
				test:"just test",
			type : 'post',
			url : '/realtime_index',
			dataType : 'json',
			timeout : 5000,
			success : function(result) {


  def get_realtime_index(request):
    test= request.POST.get('test')
    context = {
        'test':test + " in view",
    return HttpResponse(json.dumps(context), content_type="application/json")

It works.

But when I changed url like bellow:

url(r'realtime_index$', login_required(login_url='/auths/login')(views.get_realtime_index), name='realtime_index'),

when js function called, django throw an exception like this:

Exception happened during processing of request from ('', 53555)
Traceback (most recent call last):
  File "C:\Python27\lib\", line 595, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Python27\lib\", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python27\lib\site-packages\django-1.8.7-py2.7.egg\django\core\servers
\", line 102, in __init__
    super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "C:\Python27\lib\", line 653, in __init__
  File "C:\Python27\lib\", line 712, in finish
  File "C:\Python27\lib\", line 279, in close
  File "C:\Python27\lib\", line 303, in flush
error: [Errno 10053]

Can somebody tell me how to fix it?

Change History (1)

comment:1 Changed 8 years ago by Tim Graham

Resolution: invalid
Status: newclosed

I guess this may be a problem in Python instead of an issue with Django. If you can explain why Django is at fault, feel free to reopen. If you need help debugging, please see TicketClosingReasons/UseSupportChannels.

Note: See TracTickets for help on using tickets.
Back to Top