ferrix / dj-mongohq-url

Use MongoHQ URLs in your Django Application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dj-mongohq-url

https://secure.travis-ci.org/ferrix/dj-mongohq-url.png?branch=master

This simple Django utility allows you to utilize the 12factor inspired MONGOURL_URL environment variable to configure your Django application.

This is a slight adaptation of the dj-database-url by Kenneth Reitz. It is compatible with django-nonrel and can be used to dig up the URL setting for other purposes as well.

Usage

Configure your database in settings.py from DATABASE_URL (default is optional):

DATABASES = {'default': dj_mongohq_url.config(default='mongodb://...')}

Parse an arbitrary Database URL:

DATABASES = {'default': dj_mongohq_url.parse('mongodb://...')}

If you are not using Django with nonrel capabilities and merely want to dig up the MongoDB settings, use another variable:

MONGODB = dj_mongohq_url.config()

Supported databases

Support currently exists for MongoDB.

Installation

Installation is simple too:

$ pip install dj-mongohq-url

About

Use MongoHQ URLs in your Django Application.

License:BSD 2-Clause "Simplified" License


Languages

Language:Python 99.0%Language:Makefile 1.0%