Skip to main content

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

python-dotenv-run-0.1.3.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

python_dotenv_run-0.1.3-py2.py3-none-any.whl (4.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file python-dotenv-run-0.1.3.tar.gz.

File metadata

File hashes

Hashes for python-dotenv-run-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ba8d5d8cf3e7a8f04b36406eb5d93123fc8b9f2e4ea7dfa1a877d3ce09dd9eea
MD5 54d269455586dcb57f3c411cdf45de0e
BLAKE2b-256 f0f046ed3d627743a90e9fc20295484144062a19e3eb7aac0f1638cb41584a24

See more details on using hashes here.

File details

Details for the file python_dotenv_run-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for python_dotenv_run-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f01bc7e19f40137e2ce79da52af175929ce1dea81e652d348208b86c3600eeca
MD5 202266dc3b69af66c212722a5b7610e5
BLAKE2b-256 ae72c212d92483a679f9efee75e94ba85b82cc60e06cfe415e81d08c1665b637

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page