-
Notifications
You must be signed in to change notification settings - Fork 0
/
.envrc
26 lines (21 loc) · 836 Bytes
/
.envrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# direnv file
# This is just a bash script.
# https://direnv.net/man/direnv-stdlib.1.html
# https://github.com/direnv/direnv/wiki
# Activate the virtualenv
# This simply replicates what venv/bin/activate does.
# See, https://docs.python.org/3/library/venv.html#module-venv
if [[ -d "venv/bin" ]]; then
# The path to the virtualenv should be absolute. If you use ipython
# for the Django shell it will raise an error if the path is relative.
# https://github.com/ipython/ipython/issues/13268
# https://github.com/direnv/direnv/issues/304
export VIRTUAL_ENV=`pwd`/venv
PATH_add "venv/bin"
fi
# Set environment variables from .env. We're using a conditional
# in case an older version of direnv is used. In recent releases
# there is the stdlib function dotenv_if_exists
if [[ -f ".env" ]]; then
dotenv
fi