Skip to main content

Django library with Legal Consent compliance utilities and reusable apps

Project description

WeFa Django Toolkit

WeFa (Web Factory) delivers a set of modular Django apps that cover recurring web platform concerns such as authentication bootstrapping and legal consent management. The toolkit focuses on convention-over-configuration so new projects can enable production-grade defaults with minimal setup.

Table of Contents

Features

  • Shared utilities that power the higher-level apps (nside_wefa.common)
  • Plug-and-play Django REST Framework authentication configuration (token and JWT) (nside_wefa.authentication)
  • Legal consent tracking with automatic user onboarding and templated documents (nside_wefa.legal_consent)
  • System checks and sensible defaults so configuration mistakes surface early

Installation

Install the package from PyPI:

pip install nside-wefa

Or add it to your dependency file (e.g. requirements.txt):

nside-wefa>=0.1.0

Included Apps

Common

Foundational helpers shared across the toolkit. You rarely interact with it directly, but it must be installed before the other apps.

Authentication

Automatically wires Django REST Framework authentication classes, URLs, and dependency checks. See nside_wefa/authentication/README.md for the full guide.

Legal Consent

Tracks acceptance of privacy and terms documents with templating support and REST endpoints. See nside_wefa/legal_consent/README.md for details.

Quick Start

  1. Install the package.

  2. Add the apps to INSTALLED_APPS (order matters):

    INSTALLED_APPS = [
        # Django + DRF dependencies...
        "rest_framework",
        "rest_framework.authtoken",  # For token auth
        "rest_framework_simplejwt",  # For JWT auth
        "nside_wefa.common",
        "nside_wefa.authentication",
        "nside_wefa.legal_consent",
    ]
    
  3. Apply migrations:

    python manage.py migrate
    
  4. Expose the URLs you need:

    from django.urls import include, path
    
    urlpatterns = [
        # ...your URLs
        path("auth/", include("nside_wefa.authentication.urls")),
        path("legal-consent/", include("nside_wefa.legal_consent.urls")),
    ]
    

Configuration

The toolkit reads from a namespaced settings dictionary. Start with the minimal configuration below and extend it as needed:

# settings.py
NSIDE_WEFA = {
    "APP_NAME": "My Product",  # Used in legal consent templates
    "AUTHENTICATION": {
        "TYPES": ["TOKEN", "JWT"],  # Enable the authentication flows you need
    },
    "LEGAL_CONSENT": {
        "VERSION": 1,
        "EXPIRY_LIMIT": 365,  # days
        # "TEMPLATES": BASE_DIR / "templates/legal_consent",  # Optional overrides
    },
}

Validation happens through Django system checks. Run python manage.py check to surface configuration issues early.

Requirements

  • Python >= 3.12
  • Django >= 5.2.6
  • Django REST Framework >= 3.14.0
  • djangorestframework-simplejwt >= 5.5.1 (if you enable JWT support)

Local Development

Clone the repository and install the development extras:

cd django
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]

Run the demo project:

python manage.py migrate
python manage.py runserver

Execute the test suite and linters:

pytest

Contributing

We welcome feature ideas, bug reports, and pull requests. Check CONTRIBUTE for the current workflow (it will be merged with the repo-wide guidelines soon). Please include documentation updates and tests when relevant.

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

nside_wefa-0.1.0rc2.tar.gz (86.4 kB view details)

Uploaded Source

Built Distribution

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

nside_wefa-0.1.0rc2-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

Details for the file nside_wefa-0.1.0rc2.tar.gz.

File metadata

  • Download URL: nside_wefa-0.1.0rc2.tar.gz
  • Upload date:
  • Size: 86.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nside_wefa-0.1.0rc2.tar.gz
Algorithm Hash digest
SHA256 f4606a2a6c10a6067c73fec137048750602ae64ced8383b0db64757faa7ff9a3
MD5 ff291732560529865cde9f80c1eaf017
BLAKE2b-256 6c7b5884000e9d498385f1bf19ba7026e1e690e7c83989e1c2fbc783171fd451

See more details on using hashes here.

Provenance

The following attestation bundles were made for nside_wefa-0.1.0rc2.tar.gz:

Publisher: release.yml on n-side-dev/wefa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nside_wefa-0.1.0rc2-py3-none-any.whl.

File metadata

  • Download URL: nside_wefa-0.1.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 53.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nside_wefa-0.1.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 b0bdaeed34828ac18cd0ee9b8be340dc131a977973883a50fedf2a41f79ca3b9
MD5 ec3b4d2946db8bc8f59dfd3b2488c0a5
BLAKE2b-256 42f5febf3062197e76aacfb3a5234431536af7ba1801b32dbf7e5cd951d8759e

See more details on using hashes here.

Provenance

The following attestation bundles were made for nside_wefa-0.1.0rc2-py3-none-any.whl:

Publisher: release.yml on n-side-dev/wefa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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