Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uranusjr/python-dotenv-run
Run command with environment configured with python-dotenv
https://github.com/uranusjr/python-dotenv-run
dotenv python
Last synced: 2 months ago
JSON representation
Run command with environment configured with python-dotenv
- Host: GitHub
- URL: https://github.com/uranusjr/python-dotenv-run
- Owner: uranusjr
- License: isc
- Created: 2017-09-19T07:41:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-23T06:00:56.000Z (about 7 years ago)
- Last Synced: 2024-10-31T05:51:38.953Z (2 months ago)
- Topics: dotenv, python
- Language: Python
- Homepage: https://pypi.org/project/python-dotenv-run/0.1.4/
- Size: 4.88 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
=================
Pyhton-Dotenv-Run
=================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
.. _python-dotenv: https://github.com/theskumar/python-dotenv
.. _Pipenv: https://github.com/kennethreitz/pipenv