• Stars
    star
    229
  • Rank 174,666 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 11 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Python port of daemontools' envdir.

envdir (Python port)

Linux Build Status Windows Build Status

This is a Python port of daemontools' tool envdir. It works on Windows and other systems which can run Python. It's well tested and doesn't need a compiler to be installed.

envdir runs another program with a modified environment according to files in a specified directory.

So for example, imagine a software you want to run on a server but don't want to leave certain configuration variables embedded in the program's source code. A common pattern to solve this problem is to use environment variables to separate configuration from code.

envdir allows you to set a series of environment variables at once to simplify maintaining complicated environments, for example in which you have multiple sets of those configuration variables depending on the infrastructure you run your program on (e.g. Windows vs. Linux, Staging vs. Production, Old system vs. New system etc).

Let's have a look at a typical envdir:

$ tree envs/prod/
envs/prod/
├── DJANGO_SETTINGS_MODULE
├── MYSITE_DEBUG
├── MYSITE_DEPLOY_DIR
├── MYSITE_SECRET_KEY
└── PYTHONSTARTUP

0 directories, 3 files
$ cat envs/prod/DJANGO_SETTINGS_MODULE
mysite.settings
$

As you can see each file has a capitalized name and contains the value of the environment variable to set when running your program. To use it, simply prefix the call to your program with envdir:

$ envdir envs/prod/ python manage.py runserver

That's it, nothing more and nothing less. The way you structure your envdir is left to you but can easily match your configuration requirements and integrate with other configuration systems. envdirs contain just files after all.

An interesting summary about why it's good to store configuration values in environment variables can be found on the 12factor site.

Note

This Python port behaves different for multi line environment variables. It will not only read the first line of the file but the whole file. Take care with big files!

Tip

Feel free to open tickets at https://github.com/jezdez/envdir/issues.

More Repositories

1

textmate-missingdrawer

[UNMAINTAINED] A better sidebar for Textmate.
Objective-C
728
star
2

caniusepython3.com

A site to check if your Python project is compatible with Python 3
JavaScript
136
star
3

django-discover-runner

A Django test runner based on unittest2's test discovery.
Python
134
star
4

django-staticfiles

[Unmaintained] A Django app that provides helpers for serving static files, used in Django and Pinax.
Python
127
star
5

django-mobileadmin

[UNMAINTAINED] The Django admin interface optimized for iPhone/iPod touch. Pretty out of date, so be careful.
Python
117
star
6

python-startup

Python
35
star
7

pycompletion

[UNMAINTAINED] A lib to collect command line completion scripts of Python packages
Python
33
star
8

dokku-elasticsearch-plugin

[unmaintained] A working Elasticsearch plugin for Dokku (run Docker with -icc=true)
Shell
32
star
9

django-comment-utils

A fork of James Bennett's django-comment-utils that should work with Django 1.0
Python
31
star
10

django-memcached-hashring

A Django cache backend for Memcached with consistent hashing.
Python
20
star
11

gitserve

[OUTDATED, Use git instaweb instead] A helper tool for git that mimics mercurial's serve command.
Python
20
star
12

dokku-memcached-plugin

A working Memcached plugin for Dokku (run Docker with -icc=true)
Shell
19
star
13

dokku-redis-plugin

A working Redis plugin for Dokku (run Docker with -icc=true)
Shell
19
star
14

dokku-postgres-plugin

A working Postgres plugin for Dokku (run Docker with -icc=true)
Shell
17
star
15

django-rcsfield

UNSUPPORTED Mirror of django-rcsfield svn repository
Python
15
star
16

django-reusableapps

ZOMG, eggs are bad, don't use this.
Python
14
star
17

django-unchained

Python
13
star
18

django-sites-tools

DEPRECATED Use django-hosts instead!
Python
12
star
19

django-feedutil

Python
11
star
20

limechat-whisper

[UNMAINTAINED] Subtle theme for the IRC client LimeChat
11
star
21

django-vcstorage

A Django app that provides file storage backends and file fields for Mercurial, Git and Bazaar by using anyvc.
Python
10
star
22

django-ticker

A simple Django app that provides a ticker like news section including row level permission based workflow
Python
9
star
23

dokku-sentry-webhook

A plugin for Dokku that notifies Sentry of deployments for release tracking.
Shell
7
star
24

pownce-jabber-bot

A mirror of the old Subversion repository of the now defunkt Pownce jabber bot. Only for educational purposes..
Python
6
star
25

ressl

A SSL redirector for shared hosting environments, e.g. Webfaction
Python
6
star
26

django-de

The app that drives http://www.django-de.org
JavaScript
6
star
27

django-contact-form

This is here solely for legacy reasons. Don't use it. I don't support it.
Python
6
star
28

queues

Friendly fork of Matt Croydon's queues lib
Python
5
star
29

umap-dokku

Python
5
star
30

virtualmin-trac

A Virtualmin Pro install script that enables users to install Trac automatically
Perl
5
star
31

sublime-preferences

My Sublime Test 2 preferences
4
star
32

sphinxcontrib-embedly

This is a sphinx extension for using Embedly.
Python
4
star
33

django-locations

a location based social network using Django
Python
4
star
34

piwik-dokku

Nginx
4
star
35

django-openid

OpenID tools for Django
Python
4
star
36

snsz

Karte der Allgemeinverfügungen zu Schulschließungen oder eingeschränktem Regelbetrieb in Sachsen
Python
3
star
37

jzdz

A complete rip-off of bgk.me. Also a URL shortener.
Python
2
star
38

rq2test

Python
2
star
39

virtualmin-moinmoin

A Virtualmin Pro install script that enables users to install the MoinMoin wiki automatically
Perl
2
star
40

GeekTime.app

My humble PyObjC version of a Geek Time menu status app for OS X. Please fork and port it to proper ObjC. kthxbye
Python
2
star
41

isso-dokku

Python
1
star
42

pytuio

Automatically exported from code.google.com/p/pytuio
Python
1
star