Run command with environment populated by the .env file.
Project description
Run command with environment variables populated by python-dotenv.
Installation
If using Pipenv:
pipenv install --dev python-dotenv-run
Otherwhise:
pip install python-dotenv-run
Instruction onwards assumes you use Pipenv. If you do not, simply drop the pipenv run prefix in all commands.
Usage
Say you have a Flask app in a file named webapp.py:
import flask app = flask.Flask(__name__) @app.route('/') def hello(): return "Hello World!"
Add a file named .env alongside with the project:
FLASK_APP=webapp.py
After installing dependencies, you can run it like this:
pipenv run dotenv-run flask run
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python-dotenv-run-0.1.4.tar.gz
.
File metadata
- Download URL: python-dotenv-run-0.1.4.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 423a16442499726f7ecacd079d3f5dad43cfec181d39b7dd522ae58d08c58687 |
|
MD5 | c6481e48b44a5fbb1efa4f30e358f9ef |
|
BLAKE2b-256 | 16c59b832e6b227c694304f44a19256022c4e032e2db2ee9825ebe6dbc9beb6a |
File details
Details for the file python_dotenv_run-0.1.4-py2.py3-none-any.whl
.
File metadata
- Download URL: python_dotenv_run-0.1.4-py2.py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 792391893aaf5236a1a0364f14e42d2d3d9175fa2b3f30b3d8ffee316e6f3005 |
|
MD5 | 9e59d87f34b895563cf7c4f8942490d8 |
|
BLAKE2b-256 | 26370a5e0a48c65b10ea66cc6a0e5c0a4ebe08ad1919ec09d33bf1a2c4ae7421 |