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.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_eha_sdk-1.0.4-py3-none-any.whl (104.1 kB view details)

Uploaded Python 3

File details

Details for the file django_eha_sdk-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: django_eha_sdk-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 104.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.1

File hashes

Hashes for django_eha_sdk-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5070074357085ab940394deabd2bc52bae71e2252dae132b1cfa45d7bbaf84d6
MD5 86a1229b4e9d2e8fc7977542b0794899
BLAKE2b-256 9acf66e1584f1422652caf87dbb730683c2c49c245119d263df2c70ea8cb5260

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