Skip to main content

A python library with helpful django tools

Project description

Django eHealth SDK

This library contains the most common features used by the different eHealth django apps.

Table of contents

Requirements

This library requires Python 3.6 and above.

Python libraries:

  • django As web framework. (Above 2)
  • django-cors-headers for handling the server headers required for Cross-Origin Resource Sharing (CORS).
  • django-debug-toolbar A configurable set of panels that display various debug information about the current request/response.
  • django-prometheus to monitor the application with Prometheus.io.
  • django-uwsgi Django related examples/tricks/modules for uWSGI.
  • djangorestframework A powerful and flexible toolkit for building Web APIs. (Above 3.8)
  • drf-dynamic-fields Dynamically select only a subset of fields per DRF resource, either using a whitelist or a blacklist.
  • psycopg2-binary Python-PostgreSQL Database Adapter.
  • pygments A syntax highlighting package written in Python.
  • python-json-logger A python library adding a json log formatter.
  • requests HTTP for Humans.
  • uwsgi The uWSGI server.

Extra dependencies (based on settings):

  • cas

    • django-cas-ng Django CAS (Central Authentication Service) client. (Above 3.6)
  • scheduler

    • django-rq A simple app that provides django integration for RQ (Redis Queue).
    • redis The Python interface to the Redis key-value store.
    • rq Simple, lightweight, library for creating background jobs, and processing them.
    • rq-scheduler Small package that adds job scheduling capabilities to RQ.
  • server

  • storage

  • test

    • coverage A tool for measuring code coverage of Python programs.
    • flake8 Tool For Style Guide Enforcement.
    • flake8-quotes Flake8 extension for checking quotes in python.
    • tblib Traceback serialization library.
  • webpack

Return to TOC

Installation

# standalone
pip3 install django_eha_sdk

# with extra dependencies
pip3 install django_eha_sdk[cas,scheduler,server,storage,test,webpack]

Return to TOC

Distribution

How to create the package distribution

Execute the following command:

python3 setup.py bdist_wheel

or

./scripts/build.sh

Return to TOC

Tests

How to test the library

First install dependencies (execute it only once):

./scripts/install.sh

After that execute the following command:

source ./venv/bin/activate
./scripts/test.sh

The file scripts/test.ini contains the environment variables used in the tests.

Return to TOC

Usage

Add this snippet in the settings.py file to have the build the django app settings based on the environment variables.

from django_eha_sdk.conf.settings import *  # noqa

# continue with the app specific settings
# and re-import the settings variables you need to reuse
# from django_eha_sdk.conf.settings import WHATEVER YOU NEED TO...

Add this snippet in the urls.py file to generate default urlpatterns based on the app settings.

from django_eha_sdk.conf.urls import generate_urlpatterns


urlpatterns = generate_urlpatterns(token=True, app=[
    # include here the app specific urls
])

Return to TOC

Project details


Download files

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

Files for django-eha-sdk, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size django_eha_sdk-1.0.4-py3-none-any.whl (104.1 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page