skip to navigation
skip to content

Not Logged In

envauth 1.0.1

Authentication based on the ENVAUTH environment variable

Super simple authentication middleware for when you quickly need to password protect something and don’t have the time to implement rigorous authentication. Supports Flask, bottle, Django and generic WSGI servers out of the box.


envauth looks for a JSON object in the ENVAUTH environment variable. The keys are the usernames and the value contains the password for the user.

{"username": "password", "anotheruser": "pass1234"}

Heroku Example

envauth is especially useful if you happen to be running your application on a PAAS!

$ heroku config:set ENVAUTH='{"username": "password", "anotheruser": "pass1234"}'
Setting config vars and restarting application... done, v2



import envauth

@envauth.flask.requires_auth(realm='You shall not pass!')
def secret_page():
    return render_template('secret_page.html')


import envauth

@envauth.bottle.requires_auth(realm='You shall not pass!')
def secret_page():
    return template('secret_page.html')


MIDDLEWARE_CLASSES += ('envauth.django',)


import envauth

application = envauth.wsgi(application, realm='You shall not pass!')


Install envauth with pip:

$ pip install envauth
File Type Py Version Uploaded on Size
envauth-1.0.1.tar.gz (md5) Source 2014-02-26 3KB
  • Downloads (All Versions):
  • 8 downloads in the last day
  • 27 downloads in the last week
  • 164 downloads in the last month