Re: [Django] #3357: Make Django's server optionally multithreaded

2011-10-19 Thread Django
#3357: Make Django's server optionally multithreaded
-+-
 Reporter:  treborhudson@…   |Owner:  adrian
 Type:  Uncategorized|   Status:  closed
Component:  django-admin.py  |  Version:  SVN
  runserver  |   Resolution:  wontfix
 Severity:  Normal   | Triage Stage:  Design
 Keywords:  post10   |  decision needed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by wesc):

 * ui_ux:   => 0
 * easy:   => 0


Comment:

 You can also patch this by inserting this code right before the
 {{{__main__}}} block in manage.py:

 {{{
 import SocketServer
 import django.core.servers.basehttp
 django.core.servers.basehttp.WSGIServer = \
 type('WSGIServer',
  (SocketServer.ThreadingMixIn,
   django.core.servers.basehttp.WSGIServer,
   object),
  {})
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #3357: Make Django's server optionally multithreaded

2011-04-16 Thread Django
#3357: Make Django's server optionally multithreaded
-+-
   Reporter: |Owner:  adrian
  treborhudson@… |   Status:  closed
   Type: |Component:  django-admin.py
  Uncategorized  |  runserver
  Milestone: | Severity:  Normal
Version:  SVN| Keywords:  post10
 Resolution:  wontfix|Has patch:  1
   Triage Stage:  Design |  Needs tests:  0
  decision needed|
Needs documentation:  0  |
Patch needs improvement:  0  |
-+-

Comment (by egenix_viktor):

 I've also found that it is highly useful to set `allow_reuse_address =
 True` inside `ThreadedWSGIServer` on UNIX:

 {{{
 class ThreadedWSGIServer(SocketServer.ThreadingMixIn,
 simple_server.WSGIServer):
 allow_reuse_address = True
 }}}

 Otherwise is is raising "socket already in use' errors all the time you
 want to start Django this way from the second try.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #3357: Make Django's server optionally multithreaded

2011-04-07 Thread Django
#3357: Make Django's server optionally multithreaded
-+-
   Reporter: |Owner:  adrian
  treborhudson@… |   Status:  closed
   Type: |Component:  django-admin.py
  Uncategorized  |  runserver
  Milestone: | Severity:  Normal
Version:  SVN| Keywords:  post10
 Resolution:  wontfix|Has patch:  1
   Triage Stage:  Design |  Needs tests:  0
  decision needed|
Needs documentation:  0  |
Patch needs improvement:  0  |
-+-
Changes (by egenix_viktor):

 * type:   => Uncategorized
 * severity:   => Normal


Comment:

 Workaround for multi-threaded development, if you really need that. It is
 useful if you have to debug long polling (Comet) connections or stream
 content to the client, which would need more than one HTTP connection open
 at the same time. Create a new main script in your Django project
 directory with the following contents and use that to run your project
 inside the debugger (like Wing IDE):

 {{{
 """ Start Django in multithreaded mode

 It is NOT for deployment. It allows for debugging Django
 while serving multiple requests at once in multi-threaded mode.

 """

 import os, sys

 HOST = '127.0.0.1'
 PORT = 8000

 DJANGO_PROJECT_DIR = os.path.dirname(__file__)
 PARENT_DIR, DJANGO_PROJECT_NAME = DJANGO_PROJECT_DIR.rsplit(os.sep, 1)

 sys.path.append(DJANGO_PROJECT_DIR)
 os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % DJANGO_PROJECT_NAME

 import django
 import django.core.handlers.wsgi

 application = django.core.handlers.wsgi.WSGIHandler()

 if __name__ == '__main__':
 import wsgiref, SocketServer
 from wsgiref import simple_server
 class ThreadedWSGIServer(SocketServer.ThreadingMixIn,
 simple_server.WSGIServer):
 pass
 httpd = simple_server.make_server(
 HOST, PORT, application, server_class=ThreadedWSGIServer)
 print 'Serving on port %s:%d' % (HOST, PORT)
 httpd.serve_forever()
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #3357: Make Django's server optionally multithreaded

2010-11-19 Thread Django
#3357: Make Django's server optionally multithreaded
+---
  Reporter:  treborhud...@gmail.com | Owner:  adrian
Status:  closed | Milestone:
 Component:  django-admin.py runserver  |   Version:  SVN   
Resolution:  wontfix|  Keywords:  post10
 Stage:  Design decision needed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by trevorcroft):

 Allowing something like:
 manage.py runthreadedserver

 Is logically equivalent to allowing something like:
 manage.py runserver

 I think everyone will agree that you should keep runserver in django,
 therefore everyone (who is logical) would agree you could have
 runthreadedserver.

 The arguments for disallowing one are identical to disallowing the other
 (fear of stupid users abusing it, and the fact that issues arise during
 development that are not real issues), and the arguments for allowing one
 are identical for allowing the other (its a great development tool).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #3357: Make Django's server optionally multithreaded

2009-06-25 Thread Django
#3357: Make Django's server optionally multithreaded
+---
  Reporter:  treborhud...@gmail.com | Owner:  adrian
Status:  closed | Milestone:
 Component:  django-admin.py runserver  |   Version:  SVN   
Resolution:  wontfix|  Keywords:  post10
 Stage:  Design decision needed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by jaylett):

 As per the previous suggestion, see
 , a
 very simple (and in some ways utterly evil) app that does this, based on
 this patch and the `runserver` command; hence, consider it under the same
 license as Django itself.

 Drop in `INSTALLED_APPS`, set either `USE_MULTITHREADED_SERVER` or
 `USE_MULTIFORKED_SERVER` to True, and `./manage.py runconcurrentserver`.
 No warranty, but works for me on the basis of a couple of hour's use
 (still several times longer than it took to write). Use the forking
 version if threads scare you or you know your user code isn't thread safe.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #3357: Make Django's server optionally multithreaded

2009-04-26 Thread Django
#3357: Make Django's server optionally multithreaded
+---
  Reporter:  treborhud...@gmail.com | Owner:  adrian
Status:  closed | Milestone:
 Component:  django-admin.py runserver  |   Version:  SVN   
Resolution:  wontfix|  Keywords:  post10
 Stage:  Design decision needed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by anonymous):

 Why implement this as a patch? Why not just create a new custom management
 command called "runthreaded" (as opposed to the default "runserver") and
 distribute that as a separate application?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #3357: Make Django's server optionally multithreaded

2009-04-26 Thread Django
#3357: Make Django's server optionally multithreaded
+---
  Reporter:  treborhud...@gmail.com | Owner:  adrian
Status:  closed | Milestone:
 Component:  django-admin.py runserver  |   Version:  SVN   
Resolution:  wontfix|  Keywords:  post10
 Stage:  Design decision needed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by mtredinnick):

  * status:  reopened => closed
  * resolution:  => wontfix

Comment:

 Until there is clear consensus from the core developers that this is worth
 pursuing (in other words, a discussion on django-dev with positive
 confirmation, not just lack of negative confirmation on the grounds that
 we've been through it 100 times before), I hope nobody will reopen this
 ticket. Our position has been made very clear and there has not been the
 necessary groundwork laid for anybody to just reopen this. The policy is
 clearly documented, please respect that.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #3357: Make Django's server optionally multithreaded

2009-04-20 Thread Django
#3357: Make Django's server optionally multithreaded
+---
  Reporter:  treborhud...@gmail.com | Owner:  adrian
Status:  reopened   | Milestone:
 Component:  django-admin.py runserver  |   Version:  SVN   
Resolution: |  Keywords:  post10
 Stage:  Design decision needed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Comment (by cnl...@gmail.com):

 Is this going to be fixed? Its difficult to have to set up an apache
 production environment just to test my long-polling widgets.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #3357: Make Django's server optionally multithreaded

2009-01-25 Thread Django
#3357: Make Django's server optionally multithreaded
+---
  Reporter:  treborhud...@gmail.com | Owner:  adrian
Status:  reopened   | Milestone:
 Component:  django-admin.py runserver  |   Version:  SVN   
Resolution: |  Keywords:  post10
 Stage:  Design decision needed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by Almad):

 * cc: Almad (added)

Comment:

 I'd also like to add that single-threaded server makes some tests
 unmakable. Like, go check 401 with urllib2.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #3357: Make Django's server optionally multithreaded

2008-11-26 Thread Django
#3357: Make Django's server optionally multithreaded
+---
  Reporter:  [EMAIL PROTECTED] | Owner:  adrian
Status:  reopened   | Milestone:
 Component:  django-admin.py runserver  |   Version:  SVN   
Resolution: |  Keywords:  post10
 Stage:  Design decision needed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by onecreativenerd):

 * cc: onecreativenerd (added)

Comment:

 It's now post-1.0 and I have a bunch of students in need of a
 multithreading dev server for a project, so I updated the patches to work
 with 1.0, 1.0.1, 1.0.2 and latest trunk.

 The benefits to developers of a multithreaded test environment are pretty
 strong, as long as people are not deploying the devserver and developers
 are aware of the concurrency issues.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #3357: Make Django's server optionally multithreaded

2008-11-15 Thread Django
#3357: Make Django's server optionally multithreaded
+---
  Reporter:  [EMAIL PROTECTED] | Owner:  adrian
Status:  reopened   | Milestone:
 Component:  django-admin.py runserver  |   Version:  SVN   
Resolution: |  Keywords:  post10
 Stage:  Design decision needed | Has_patch:  1 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by ubernostrum):

  * stage:  Accepted => Design decision needed

Comment:

 Something that's been wontfix'd twice by one of Django's lead devs sure as
 heck isn't "Accepted".

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---