Skip to main content

Provides utility functions for Django

Project description

Pursuit Library - Django

This package provides utility functions and classes for Django (and Select2).

It also contains static files for:

Configuration

The following values should be added to the Django configuration:

from pursuitlib.utils import get_env

VERSION = "PROJECT_VERSION"
DEV_STAGE = "PROJECT_DEV_STAGE"
DISPLAY_VERSION = VERSION if DEV_STAGE is None else VERSION + " " + DEV_STAGE

DOMAIN = get_env('PROJECTNAME_DOMAIN')
USE_HTTPS = get_env('PROJECTNAME_USE_HTTPS').lower() == 'true'
BASE_URL = ("https://" if USE_HTTPS else "http://") + DOMAIN

Error handling

To enable error handling, add he following lines to your main urls.py file:

# Error handling

handler400 = "pursuitlib_django.errors.error_400"
handler403 = "pursuitlib_django.errors.error_403"
handler404 = "pursuitlib_django.errors.error_404"

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

pursuitlib-django-0.3.2.tar.gz (1.5 MB view hashes)

Uploaded Source

Built Distribution

pursuitlib_django-0.3.2-py3-none-any.whl (1.6 MB view hashes)

Uploaded Python 3

Supported by

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