-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #52 - Enable .env support with python-dotenv #54
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this! This is an even more comprehensive and automated approach than I imagined. 🤖 I also really appreciate your detailed documentation, including the descriptive error message for missing values. 💜
I have a few small notes on the PostgreSQL connection strings, as well as an optional suggestion for improving some Python readability.
`postgres://localhost/faces` | ||
or | ||
`postgres:///faces`, | ||
to connect over TCP/IP to the database named `faces`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this got modified in the move. postgres:///faces
connects over the Unix domain socket to the database named faces
, and I think should probably be the default; postgresql://localhost/
connects over TCP/IP to the default database for your user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, now that I reread this, I was very unclear about what my concern was here!
Right now, this sentence says:
Alternate database URLs you might try are
postgres://localhost/faces
orpostgres:///faces
, to connect over TCP/IP to the database namedfaces
.
The former connects via TCP/IP, but the latter connects via a Unix domain socket, so the explanation at the end is wrong.
Perhaps it could read:
An alternate database URL you might try is:
postgres://localhost/faces
to connect over TCP/IP to the database namedfaces
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, sorry for the misunderstanding! Corrected with your suggestion 😄
Just made all the changes requested and re-pushed |
enable the variable `REACT_APP_USE_TEST_DATA=true`, | ||
and then starting the React app is as simple as: | ||
```sh | ||
$ npm run start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, does this work for NPM?
…te README to describe how to populate file from provided env.template
This commit adds the python-dotenv dependency to manage environment variables, removing the need to specify them in line with the commands to use test data, run the database updates, and start the Flask app.
The README now includes a section on how to copy the provided
env.template
and modify it to populate the required variables in a new.env
file that will not be under version control (and was added to.gitignore
.The Flask environment variables
FLASK_APP
andFLASK_ENV
can be safely added to version control, and are included in the new.flaskenv
file. Thepython-dotenv
library will combine the two with.env
taking precedence over.flaskenv
if there are conflicts.