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
- sentry-sdk Python client for Sentry.
-
storage
- django-minio-storage A django storage driver for minio.
- django-storages A collection of custom storage backends for Django. Enabled for boto3 and google-cloud-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
- django-webpack-loader Transparently use webpack with django.
Installation
# standalone
pip3 install django_eha_sdk
# with extra dependencies
pip3 install django_eha_sdk[cas,scheduler,server,storage,test,webpack]
Distribution
How to create the package distribution
Execute the following command:
python3 setup.py bdist_wheel
or
./scripts/build.sh
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.
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
])
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
Built Distribution
Hashes for django_eha_sdk-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d888c4cea319d3eb34f43e7f0522f713e18905bfd24f4e01d4f7dbf2d26ad73 |
|
MD5 | b8a4d30946d38f4d8b54e9787fd322b9 |
|
BLAKE2b-256 | 65f0de93be8005d98e85e3f7016b0fd43929edf8ec8e1396920d98caa29f13dc |