On Fri, Aug 21, 2009 at 16:35, Alessandro
Ronchi<alessandro.ron...@soasi.com> wrote:
>
> 2009/8/21 Alessandro Ronchi <alessandro.ron...@soasi.com>:
>>
>> one thing like that :
>> from PROJECT_ROOT.local_settings import *
>>
>> Thanks in advance
>
> I correct myself:
>
> I need PROJECT_NAME to import, not the project root.
>
> I can then import it with
>
> exec "from " + settings.PROJECT_NAME +".local_cms_settings import *"
>
> is there another way to get the project name without hardcoding it to 
> settings?

The root directory of your Django project should be in sys.path
anyway, so a simple 'import local_cms_settings' should just work. Even
if not, putting the directory into sys.path is much less evil/hacky
than using exec/eval.

HTH

~jan

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