Re: [Django] #8085: call_command('runserver') executes management command twice.

2013-11-08 Thread Django
#8085: call_command('runserver') executes management command twice.
-+-
 Reporter:  ericholscher |Owner:
 Type:  Bug  |   Status:  closed
Component:  Core (Management |  Version:  master
  commands)  |   Resolution:  needsinfo
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Someday/Maybe
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Hipikat):

 Hi. I just encountered this, too…

 The problem is just that the reloader starts news threads, and so…
 {{{django.utils.autoreload.restart_with_reloader}}} calls
 {{{new_environ["RUN_MAIN"] = 'true'}}} and then
 {{{django.utils.autoreload.python_reloader}}} knows to look, for {{{if
 os.environ.get("RUN_MAIN") == "true":}}} then it's in a spawned thread.
 The solution is just to check that {{{RUN_MAIN}}} is {{{False}}} in your
 {{{handle}}} method…
 {{{
 # some_app.management.commands.some_command.py
 import os
 from django.core.management.commands import runserver
 class Command(runserver.Command):
 def handle(self, *args, **options):
 if not os.environ.get('RUN_MAIN', False):
 # some_code
 super(Command, self).handle(*args, **options)
 }}}
 Anyway, I'm guessing this is too esoteric and internal to justify a note
 anywhere in the main documentation, but I'm not going to be the last
 person to get stumped by it, so commenting on this issue seemed like the
 appropriate place to mention the solution? :)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.1cf7a5a8b63616e7c0f3d3187ddec528%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #8085: call_command('runserver') executes management command twice.

2012-12-16 Thread Django
#8085: call_command('runserver') executes management command twice.
-+-
 Reporter:  ericholscher |Owner:
 Type:  Bug  |   Status:  closed
Component:  Core (Management |  Version:  master
  commands)  |   Resolution:  needsinfo
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Someday/Maybe
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => needsinfo


Comment:

 Reading this ticket, I don't understand what the problem is, or what the
 fix should be.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #8085: call_command('runserver') executes management command twice.

2009-12-22 Thread Django
#8085: call_command('runserver') executes management command twice.
+---
  Reporter:  ericholscher   | Owner: 
Status:  new| Milestone: 
 Component:  django-admin.py runserver  |   Version:  SVN
Resolution: |  Keywords: 
 Stage:  Someday/Maybe  | Has_patch:  0  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Changes (by SmileyChris):

  * stage:  Unreviewed => Someday/Maybe

-- 
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] #8085: call_command('runserver') executes management command twice.

2009-11-10 Thread Django
#8085: call_command('runserver') executes management command twice.
+---
  Reporter:  ericholscher   | Owner: 
Status:  new| Milestone: 
 Component:  django-admin.py runserver  |   Version:  SVN
Resolution: |  Keywords: 
 Stage:  Unreviewed | Has_patch:  0  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Comment (by tiberiu_ichim):

 My problem is solved if I run "runserver" with the --noreload option, so
 the problem must be in django.utils.autoreloader.
 Some details about my setup: my python is actually a script generated with
 zc.recipes.egg's "interpreter" option. This script inserts all my egg
 dependencies in the sys.path, then calls an execfile(mymodule). I think
 the autoreloader only looks at the module that was executed (manage.py)
 but ignores the special settings for sys.path that that module had.

-- 
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] #8085: call_command('runserver') executes management command twice.

2009-11-10 Thread Django
#8085: call_command('runserver') executes management command twice.
+---
  Reporter:  ericholscher   | Owner: 
Status:  new| Milestone: 
 Component:  django-admin.py runserver  |   Version:  SVN
Resolution: |  Keywords: 
 Stage:  Unreviewed | Has_patch:  0  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  0  |  
+---
Changes (by tiberiu_ichim):

  * stage:  Someday/Maybe => Unreviewed

Comment:

 One issue I have related to this: the second time the code is executed, in
 my setup (I'm using zc.buildout, and I have Django listed as an egg
 dependency for my own egg), it can't find the django modules.

-- 
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] #8085: call_command('runserver') executes management command twice.

2009-02-15 Thread Django
#8085: call_command('runserver') executes management command twice.
+---
  Reporter:  ericholscher   | Owner:  
Status:  new| Milestone:  post-1.0
 Component:  django-admin.py runserver  |   Version:  SVN 
Resolution: |  Keywords:  
 Stage:  Someday/Maybe  | Has_patch:  0   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Changes (by ericholscher):

  * owner:  ericholscher =>
  * status:  assigned => new

-- 
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
-~--~~~~--~~--~--~---