2009/8/22 Jan Hülsbergen :
>
> 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.
my project is on sys.path, but if I
On Fri, Aug 21, 2009 at 16:35, Alessandro
Ronchi wrote:
>
> 2009/8/21 Alessandro Ronchi :
>>
>> 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
>
I need to write a setting in my settings.py that uses my model, but
it's not possible to load models inside settings.py
So I need to import a custom local_settings.py to be loaded by my app.
It should be simple:
from myapp.settings import *
but I want to remove "myapp" to that import, because I
2009/8/21 Alessandro Ronchi :
>
> 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 th
4 matches
Mail list logo