(Aug-15-2019, 10:30 PM)Truman Wrote: Maybe I should just delete that config file.That would not work well at all,as nothing would work
Truman Wrote:I don't use the environment at all, it goes on my nerve. lol.Then make your own bye using python-dotenv.
Just a quick demo using it in this projects.
Now need to read
SECRET_KEY
from environment. import os class Config: SECRET_KEY = os.getenv('SECRET_KEY') SQLALCHEMY_DATABASE_URI = 'sqlite:///site.db' MAIL_SERVER = 'smtp.googlemail.com' MAIL_PORT = 587 MAIL_USE_TLS = True MAIL_USERNAME = '[email protected]' MAIL_PASSWORD = '99999'Folder file setup add
.env
,Flask will automatically find this .env
file as this feature is integrated in Flask 1.0 -->.11-Blueprints\ |-- run.py |-- .env flaskblog\.env:
SECRET_KEY='12345'Now have environment reading in project,and do not need to mess with OS environment variables.
No error in part 11 when i test after doing modifications in my two last post.