Skip to main content

Reusable Django building blocks for multi-app deployments

Project description

django-infra-core

Reusable package for shared Django architecture across multiple services.

What this package provides

  • Abstract base models for institution and student domains
  • Admin mixin for institution scoped access
  • Settings helpers for env driven configuration
  • Auth utilities and middleware to attach institution context

Installation

pip install django-infra-core==0.1.1

Quick usage

# settings.py
INSTALLED_APPS = [
    # ...
    "infra_core",
]

# models.py
from infra_core.models import BaseInstitution, BaseStudent
from infra_core.admin import InstitutionScopedAdminMixin, ImportExportAdminMixin, BaseModelResource

class Institution(BaseInstitution):
    pass

class Student(BaseStudent):
    institution = models.ForeignKey(
        Institution,
        on_delete=models.CASCADE,
        related_name="students",
    )

## Included Institution fields (BaseInstitution)

- name (Kurum Adı)
- code (Kurum Kodu)
- address (Adres)
- location (Konum)
- phone (Telefon)
- email (E-posta)
- gender (Cinsiyet)
- institution_type (Kurum Türü)
- manager (Kurum Yöneticisi)
- is_active (Aktif)
- created_at / updated_at (Oluşturulma/Güncellenme Tarihi)

## Included Student fields (BaseStudent)

- first_name (Öğrenci Adı)
- last_name (Öğrenci Soyadı)
- grade (Sınıf)
- level (Seviye)
- status (Aktif)
- created_at / updated_at (Oluşturulma/Güncellenme Tarihi)

`BaseStudent.clean()` metodu, `institution.institution_type` değerine göre `grade` ve `level` alanlarını doğrular.

## Import/Export shared classes

- `BaseModelResource`: Ortak import/export resource ayarları
- `ImportExportAdminMixin`: Ortak import/export admin mixin

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

django_infra_core-0.1.5.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

django_infra_core-0.1.5-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file django_infra_core-0.1.5.tar.gz.

File metadata

  • Download URL: django_infra_core-0.1.5.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for django_infra_core-0.1.5.tar.gz
Algorithm Hash digest
SHA256 6d8db15c818f6e8ea4a9f3d5d1d2611b0b1e0dbb9535d381bc07b5642af27712
MD5 47a6204023b12ecaea6f6365d8c95fcf
BLAKE2b-256 3e2bd07b829c6af1bb4bdec47d4672e53845c4ee6e4978b0704a9634109ed687

See more details on using hashes here.

File details

Details for the file django_infra_core-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for django_infra_core-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 fe3bbd5112c4a128772876501fc6cf3afc448967c5340d14d6114daa614418b3
MD5 0a9f85bc84768a92166a59983b38c2c9
BLAKE2b-256 8574c6677319fc9cd2a531adeae90f52d37c32d50443817545c63c37cc85a0cf

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