gargoyle

Software Screenshot:
gargoyle
Software Details:
Version: 0.10.8
Upload Date: 20 Feb 15
Developer: Disqus
Distribution Type: Freeware
Downloads: 8

Rating: nan/5 (Total Votes: 0)

gargoyle is a platform for dealing with feature toggles in Django.

Install it:

pip install gargoyle

Enable it:

If you dont have Nexus already enabled, you will need to do that first:

# settings.py

INSTALLED_APPS = (
 ...
 'nexus',
)

# urls.py

import nexus

nexus.autodiscover()

urlpatterns = patterns('',
 ('^nexus/', include(nexus.site.urls)),
)

(Nexus is a replacement for your Django admin, that works with django.contrib.admin)

 # settings.py

 INSTALLED_APPS = (
 ... 'gargoyle',

 )


Use it:


# as a decorator
from gargoyle.decorators import switch_is_active

@switch_is_active('my switch name')
def my_view(request):
 return 'foo'

# within your functions
from gargoyle import gargoyle

def my_function(request):
 if gargoyle.is_active('my switch name', request):
 return 'foo'
 else:
 return 'bar'

# with custom objects
from gargoyle import gargoyle

def my_method(user):
 if gargoyle.is_active('my switch name', user):
 return 'foo'
 else:
 return 'bar'


Extend it:

# myapp/gargoyle.py
from gargoyle import conditions
from django.contrib.sites.models import Site

class SiteConditionSet(conditions.ModelConditionSet):
 percent = conditions.Percent()
 domain = conditions.String()

gargoyle.register(SiteConditionSet(Site))

gargoyle.is_active('my switch name', Site.objects.get_current())

Requirements:

  • Django
  • Python

Other Software of Developer Disqus

Comments to gargoyle

Comments not found
Add Comment
Turn on images!