Skip to main content

Django-related utilities

Project description

by John Mark Schofield (jms@schof.org)

Provides common utility functions for Django projects.

(It’s django-fu as in Kung Fu, not as in F-U.)

Currently provides django-fu.djangoenvironment.get_env_variable().

Loads an environment variable into the current context, or raises an exception.

Usage:

>>> from djangofu.general import get_env_variable
>>> get_env_variable('SHELL')
'/bin/bash'
>>> get_env_variable('foobar')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/schof/.virtualenvs/dbfweb/lib/python2.7/site-packages/djangofu/general.py", line 12, in get_env_variable
    raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: Set the foobar environment variable
>>>

Thanks

get_env_variable was taken from the book “Two Scoops of Django,” by Daniel Greenfield and Audrey Roy. [https://django.2scoops.org/]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangofu-0.0.6.tar.gz (1.3 kB view details)

Uploaded Source

File details

Details for the file djangofu-0.0.6.tar.gz.

File metadata

  • Download URL: djangofu-0.0.6.tar.gz
  • Upload date:
  • Size: 1.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for djangofu-0.0.6.tar.gz
Algorithm Hash digest
SHA256 643c9fc5a6b5251f5ac3e79410949bd63369c9e495c7cdfa424a948f3ba6908d
MD5 626f4f88a845a6073cf3544ff08a6300
BLAKE2b-256 3bebe1ee914b5d490201519627f5e5ac3a9660135d501ef12cc9f0bc15a784c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page