FLAT_CONF=DEV doesn't work for latest version #66

Closed
houmie opened this Issue Jan 15, 2014 · 4 comments

Comments

Projects
None yet
3 participants
@houmie

houmie commented Jan 15, 2014

Guys, not sure if anyone came across that:
If I run this in the terminal (Mac)

 export FLASK_CONF=DEV

and then start the app through dev_appserver.py src/ but logging.info() shows it has not loaded the development environment.

Same is in Eclipse:

Even though Eclipse.s environment is set to FLASK_CONF=DEV the break point never goes into if os.getenv('FLASK_CONF') == 'DEV':. When I run the tests though, I see elif os.getenv('FLASK_CONF') == 'TEST': is hitting.

if os.getenv('FLASK_CONF') == 'DEV':
    #development settings not to be used in production
    app.config.from_object('application.settings.Development')
    # Flask-DebugToolbar (only enabled when DEBUG=True)
    toolbar = DebugToolbarExtension(app)
    # Werkzeug Debugger - enabled by default in new versions of Flask 
    #if you set debug to true, right?
    # app.wsgi_app = DebuggedApplication(app.wsgi_app, evalex=True) 
elif os.getenv('FLASK_CONF') == 'TEST':
    app.config.from_object('application.settings.Testing')

Why is this not working anymore. Anyone came across that yet?
Many Thanks for your help,
Hooman

@houmie

This comment has been minimized.

Show comment Hide comment
@houmie

houmie Jan 15, 2014

I believe this stopped working since I upgraded my OSX to Mavericks. Can anyone confirm this please?

houmie commented Jan 15, 2014

I believe this stopped working since I upgraded my OSX to Mavericks. Can anyone confirm this please?

@plainOldCode

This comment has been minimized.

Show comment Hide comment
@plainOldCode

plainOldCode Jan 16, 2014

I had a same problems.

I added

2014-01-16 11 51 17

env_variables:
FLASK_CONF:'TEST'

this line to 'app.yaml'

and it works.

I had a same problems.

I added

2014-01-16 11 51 17

env_variables:
FLASK_CONF:'TEST'

this line to 'app.yaml'

and it works.

@kamalgill

This comment has been minimized.

Show comment Hide comment
@kamalgill

kamalgill May 16, 2014

Owner

Workaround suggested by @plainOldCode appears to work -- thanks for the tip!

Owner

kamalgill commented May 16, 2014

Workaround suggested by @plainOldCode appears to work -- thanks for the tip!

@kamalgill kamalgill closed this May 16, 2014

@houmie

This comment has been minimized.

Show comment Hide comment
@houmie

houmie May 20, 2014

It is not a great solution if you have to change a config file to make it unit-testable. These things should be driven through environment settings only.

houmie commented May 20, 2014

It is not a great solution if you have to change a config file to make it unit-testable. These things should be driven through environment settings only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment