Importing modules with variable paths?
<p>I have dev and production systems.</p>

<p>My production system is different from my dev system in that that it adds one directory to the beginning path.</p>

<p>for eg. on dev system:</p>

<p>main->module1->module2</p>

<p>becomes on production:</p>

<p>project_name->main->module1->module2.</p>

<p>Because of that I have to change all my imports to accommodate for this change.</p>

<p>I wanted to make settings file in the main folder and include it in every file and call exec("import %s.modulexxx" % path).</p>

<p>But the problem is how to access settings file (because I also need to know my directory path).</p>

<p>Is there a way to include some file below, for eg. :</p>

<p>if it is main->module1->module2 , in module2 I could include ../../settings.py
so if it changes to project_name->main->module1->module2 it would still work because it would still be 2 level below.</p>

<p>Any help?</p>
