On Aug 3, 2:46 am, joep <joe.archet...@gmail.com> wrote:
> Hi all,
>
> I have both a project and an app I just created (using django-admin).
> I modified the __init.py__ file in the app to execute a print
> statement on import. But it gets executed twice when I start the
> development server.
>
> Oddly, it doesn't happen when I set USE_I18N = False in the settings
> file. I'm new to python and django, so I'm not sure what to make of
> this behavior. Is is normal? My understanding of python is that I
> would expect the print statement to only execute once, but perhaps I
> don't understand.
>
> Any help in understanding greatly appreciated.

The thing is that i18n initialization process consists of importing
modules (again) and
"translating" it to the requested language.

You can check django.utils.translation.translation() for more info.

When i18n is disabled, no need to translate anything and django.core
imports modules only once.

Please, correct me if I'm wrong.
--
apl

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to