Hi,

settings.py gets imported twice. This is bad, if you want to
set up the logging module, since you register the handler twice
and you get all log messages twice.

Here are the stacktraces I created for debugging this:

===> python manage.py test admin
import logconfig
Traceback (most recent call last):
  File "manage.py", line 12, in ?
    import settings # Assumed to be in the same directory.


Traceback (most recent call last):
  File "manage.py", line 19, in ?
    execute_manager(settings)
  File "/localhome/user/myproject/django/core/management/__init__.py", line 
277, in execute_manager
    utility.execute()
  File "/localhome/user/myproject/django/core/management/__init__.py", line 
225, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/localhome/user/myproject/django/core/management/__init__.py", line 
177, in fetch_command
    self.project_directory)[subcommand]
  File "/localhome/user/myproject/django/core/management/__init__.py", line 86, 
in get_commands
    for app_name in settings.INSTALLED_APPS:
  File "/localhome/user/myproject/django/conf/__init__.py", line 28, in 
__getattr__
    self._import_settings()
  File "/localhome/user/myproject/django/conf/__init__.py", line 57, in 
_import_settings
    self._target = Settings(settings_module)
  File "/localhome/user/myproject/django/conf/__init__.py", line 83, in __init__
    mod = __import__(self.SETTINGS_MODULE, {}, {}, [''])
  File "/localhome/user/myproject/settings.py", line 147, in ?

This shnippet has a workaround:
  http://www.djangosnippets.org/snippets/16/
(I have not tested it yet)

I think it would be better to avoid a second import.

Any hints?

 Thomas

-- 
Thomas Güttler, http://www.tbz-pariv.de/ 
Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917
TBZ-PARIV GmbH  Geschäftsführer: Dr. Reiner Wohlgemuth
Sitz der Gesellschaft: Chemnitz Registergericht: Chemnitz HRB 8543

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to