Last Updated: February 25, 2016
·
8.627K
· agam360

How to create a separate config file with flask

First create a config.cfg file.
Contents:
HELLO='Hi!'
Then in your main python file for flusk (where you run everything):

app = Flask(__name__)

`app.config.from_pyfile('config.cfg')

And use it like so:
app.config['HELLO']

2 Responses
Add your response

Looks like you have a typo in the title :)

over 1 year ago ·

I think that I fixed it, thanks!

over 1 year ago ·