[Tutor] Namespace question

Tino Dai oberoc at gmail.com
Fri Jan 20 19:34:23 CET 2012


Hi everybody,

     Got a namespace question framed inside a Django project (but I still
think it's pertinent to Python). We moved and broke settings.py four
different files in a separate directory called settings. So instead of
doing a

>>> import settings
>>> settings.whatever

We are having to do:

>>> import settings
>>> settings.settings.whatever

This is inconvenient and probably will break stuff especially with django
framework code. Is there a way to play with the namespacing to have python
have the former behavior rather than the latter behavior?

Thanks,
Tino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120120/cbc1541e/attachment.html>


More information about the Tutor mailing list