djangosnippets.org: Latest snippets posted by LorenDaviehttps://djangosnippets.org/users/LorenDavie/2010-05-20T15:51:41.234408-05:00LorenDavieCapture Stack Trace Decorator
2010-05-20T15:51:41.234408-05:00LorenDaviehttps://djangosnippets.org/snippets/2029/<p>Put this decorator on any function to capture any exceptions generated within and print to a stack trace.</p>
<p>example:</p>
<p>@catch
def my_func():
# code that may raise an exception here</p>
Freely redistributableDynamic Backends
2008-09-28T13:24:58.173972-05:00LorenDaviehttps://djangosnippets.org/snippets/1090/<p>This allows various implementations of a common interface to be loaded. Back end modules can be specified in settings.py, and from there be loaded and treated polymorphically by an application.</p>
Freely redistributableAccessing Environment Variables in Templates
2008-07-31T08:56:32.870615-05:00LorenDaviehttps://djangosnippets.org/snippets/933/<p>This snippet uses the <a href="http://code.google.com/p/django-environment/">django-environment project</a>. Django-environment is used to provide "environment variables" to django apps.</p>
Freely redistributableAccessing Environment Variables in Views
2008-07-31T08:49:45.017029-05:00LorenDaviehttps://djangosnippets.org/snippets/932/<p>This snippet uses the <a href="http://code.google.com/p/django-environment/">django-environment project</a>. Django-environment is used to provide "environment variables" to django apps.</p>
Freely redistributable