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.7

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.8.1.tar.gz (8.0 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.8.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for django_infra_core-0.1.8.1.tar.gz
Algorithm Hash digest
SHA256 0e5cce73920e5d3e286ef3cb15b00f7624c1cbb9ee948bf4275c2df2ae499875
MD5 6a1c3f02f05b9539ffc980e51c810291
BLAKE2b-256 8aae8d48d37953b3a3859e6b48e4ffd7b8e031a8a2136a12450a64440ec448e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_infra_core-0.1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f11257de8dab3210c426c8fc7b3f0d5a1e15cd6abc70ec31828e9d95cb4a220
MD5 1e628df2804303c20d74deb311f23642
BLAKE2b-256 45a35c6937b8b37988869c639aac43796dd113679a71512aa970c9068b500a2d

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