@@ -90,7 +90,7 @@ Installation
9090
9191::
9292
93- pip install python-dotenv --upgrade
93+ pip install -U python-dotenv
9494
9595Command-line interface
9696======================
@@ -132,18 +132,20 @@ server.
132132
133133 # fabfile.py
134134
135- from fabric.api import task, run, env
136135 import dotenv
136+ from fabric.api import task, run, env
137137
138138 # absolute path to the location of .env on remote server.
139- env.dotenv_path = ' /home/me/webapps/myapp /myapp/.env'
139+ env.dotenv_path = ' /opt /myapp/.env'
140140
141141 @task
142142 def config (action = None , key_value = None ):
143143 ''' Manage project configuration via .env
144144
145- see: https://github.com/theskumar/python-dotenv
146- e.g: fab config:set[,key][=value]
145+ e.g: fab config:set,<key>=<value>
146+ fab config:get,<key>
147+ fab config:unset,<key>
148+ fab config:list
147149 '''
148150 run(' touch %(dotenv_path)s ' % env)
149151 command = dotenv.get_cli_string(env.dotenv_path, action, key_value)
@@ -155,57 +157,33 @@ Get all your remote config info with ``fab config``
155157
156158::
157159
158- $ fab config:list
159- [...example.com] Executing task 'config'
160- [...example.com] run: dotenv -f /home/me/webapps/myapp/myapp/.env list
161- [...example.com] out: DJANGO_DEBUG="true"
162- [...example.com] out: DJANGO_ENV="test"
160+ $ fab config
163161
164- Set remote config variables with ``fab config:set,[ key],[ value] ``
162+ Set remote config variables with ``fab config:set,< key>=< value> ``
165163
166164::
167165
168166 $ fab config:set,hello=world
169- [...example.com] Executing task 'config'
170- [...example.com] run: dotenv -f /home/me/webapps/myapp/myapp/.env set hello world
171- [...example.com] out: hello="world"
172167
173- Get a single remote config variables with ``fab config:get,[ key] ``
168+ Get a single remote config variables with ``fab config:get,< key> ``
174169
175170::
176171
177172 $ fab config:get,hello
178- [...example.com] Executing task 'config'
179- [...example.com] run: dotenv -f /home/me/webapps/myapp/myapp/.env get hello
180- [...example.com] out: hello="world"
181173
182- Delete a remote config variables with ``fab config:unset,[ key] ``
174+ Delete a remote config variables with ``fab config:unset,< key> ``
183175
184176::
185177
186178 $ fab config:unset,hello
187- [...example.com] Executing task 'config'
188- [...example.com] run: dotenv -f /home/me/webapps/myapp/myapp/.env unset hello
189- [...example.com] out: unset hello
190179
191180Thanks entirely to fabric and not one bit to this project, you can chain
192- commands like so ``fab config:set,[ key1][= value1] config:set,[ key2][= value2] ``
181+ commands like so ``fab config:set,< key1>=< value1> config:set,< key2>=< value2> ``
193182
194183::
195184
196185 $ fab config:set,hello=world config:set,foo=bar config:set,fizz=buzz
197- [...example.com] Executing task 'config'
198- [...example.com] run: dotenv -f /home/me/webapps/myapp/myapp/.env set hello world
199- [...example.com] out: hello="world"
200- [...example.com] Executing task 'config'
201- [...example.com] run: dotenv -f /home/me/webapps/myapp/myapp/.env set foo bar
202- [...example.com] out: foo="bar"
203- [...example.com] Executing task 'config'
204- [...example.com] run: dotenv -f /home/me/webapps/myapp/myapp/.env set fizz buzz
205- [...example.com] out: fizz="buzz"
206-
207- That's it. example.com, or whoever your non-paas host is, is now 1 facor
208- closer to an easy 12 factor app.
186+
209187
210188Releated Projects
211189=================
0 commit comments