<div dir="ltr"><div>Environmental variable are read through a command prompt. So if you want to set the variable "APP_CONFIG_FILE" you would have to type the following into a command prompt before running your program:<br></div><div><div><br></div><div>On Linux or Max OSX:</div><div>export APP_CONFIG_FILE = "path_to_file"</div><div><br></div><div>On Windows:</div><div>set APP_CONFIG_FILE = "path_to_file"<br></div><div><br></div><div>I would suggest for you to read <a href="http://stackoverflow.com/questions/4906977/how-to-access-environment-variables-from-python" target="_blank">this</a> to learn how to properly access the content in the environmental variable.</div></div><div><br></div><div>Though, I believe that you're looking to load the config from a file. Then <a href="http://flask.pocoo.org/docs/0.10/config/#configuring-from-files" target="_blank">this</a> should clear things up.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 11, 2015 at 7:14 PM, west alto <span dir="ltr"><<a href="mailto:westalto@gmail.com" target="_blank">westalto@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Gurus,<div><br></div><div>Noob here. It makes me nuts figuring this out. Kindly help.</div><div><br></div><div><ol style="margin:0px;padding:0px 0px 0px 48px;color:rgb(172,172,172);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono',monospace,serif;font-size:12px;line-height:21px;background-color:rgb(248,248,248)"><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)"><span style="color:rgb(255,119,0);font-weight:bold">import</span> <span style="color:rgb(220,20,60)">os</span></div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)"> </div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)"><span style="color:rgb(255,119,0);font-weight:bold">from</span> flask.<span>ext</span>.<span>script</span> <span style="color:rgb(255,119,0);font-weight:bold">import</span> Manager</div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)"><span style="color:rgb(255,119,0);font-weight:bold">from</span> api <span style="color:rgb(255,119,0);font-weight:bold">import</span> api</div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)"> </div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)"> </div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)">manager <span style="color:rgb(102,204,102)">=</span> Manager<span>(</span>api<span>)</span></div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)"> </div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)"> </div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)"><span style="color:rgb(255,119,0);font-weight:bold">def</span> runserver<span>(</span><span>)</span>:</div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)">    api.<span>run</span><span>(</span><span>)</span></div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)"> </div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)"> </div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)"><span style="color:rgb(255,119,0);font-weight:bold">if</span> __name__ <span style="color:rgb(102,204,102)">==</span> <span style="color:rgb(72,61,139)">'__main__'</span>:</div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)">    root_dir <span style="color:rgb(102,204,102)">=</span> <span style="color:rgb(220,20,60)">os</span>.<span>path</span>.<span>abspath</span><span>(</span><span style="color:rgb(220,20,60)">os</span>.<span>path</span>.<span>dirname</span><span>(</span>__file__<span>)</span><span>)</span></div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)">    <span style="color:rgb(220,20,60)">os</span>.<span>environ</span><span>[</span><span style="color:rgb(72,61,139)">"APP_CONFIG_FILE"</span><span>]</span> <span style="color:rgb(102,204,102)">=</span> <span style="color:rgb(220,20,60)">os</span>.<span>path</span>.<span>join</span><span>(</span>root_dir<span style="color:rgb(102,204,102)">,</span> <span style="color:rgb(72,61,139)">'env/dev.py'</span><span>)</span></div></li><li><div style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background:rgb(255,255,255)">    manager.<span>run</span><span>(</span><span>)</span></div></li></ol></div><div><br></div><div>running python manage.py runserver gives me this error</div><div><br></div><div>RuntimeError: The environment variable 'APP_CONFIG_FILE' is not set and as such configuration could not be loaded.  Set this variable and make it point to a configuration file<br></div><div><br></div><div><br></div><div>Thanks,</div><div><br></div><div>West</div><div><br></div><div><br></div></div>
<br>_______________________________________________<br>
Flask mailing list<br>
<a href="mailto:Flask@python.org">Flask@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/flask" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/flask</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Robinson Collado</div><div>Web Developer - <a href="http://robinsonc.com" target="_blank">robinsonc.com</a></div></div></div></div></div></div></div>
</div>