Skip to main content

A command-line tool to generate Django projects and apps following the hexagonal (ports and adapters) architecture.

Project description

Django Hexagonal Architecture

A command-line tool to generate Django projects and apps following the hexagonal (ports and adapters) architecture.


What is this?

django-hexagonal-cli is a CLI utility that helps you quickly scaffold Django projects and apps with a clean hexagonal structure, ready for scalable, maintainable, and testable development.

Installation

pip install django-hexagonal-cli

This will provide the django-admin-hex command.

Usage

  • Create a new project:

    django-admin-hex startproject <project_name> [<first_app_name>]
    

    This generates a Django project with the recommended hexagonal structure. Optionally, you can create the first app at the same time.

  • Create a new app in an existing project:

    cd <project_name>
    django-admin-hex startapp <app_name>
    

    This creates a new app inside the apps/ folder, following the hexagonal pattern.

Project Structure Example

project_root/
├── apps/
│   └── <app_name>/
│       ├── application/
│       ├── domain/
│       ├── infrastructure/
│       └── interfaces/
├── config/
├── manage.py
├── pyproject.toml
└── README.md

Why Hexagonal Architecture?

  • Promotes separation of concerns
  • Makes testing and maintenance easier
  • Adapts easily to new frameworks or external services

Example

This repository includes a working example of a Django project with hexagonal architecture in the example/ folder. You can explore it to see a real API implementation using this structure.

Resources

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_hexagonal_cli-0.1.1.tar.gz (6.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_hexagonal_cli-0.1.1-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file django_hexagonal_cli-0.1.1.tar.gz.

File metadata

  • Download URL: django_hexagonal_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.11 Linux/6.11.0-1018-azure

File hashes

Hashes for django_hexagonal_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 559ae07c8e3cf26fa94e2372a22cffa4d8d3f510c1a8cd0fa13954bb2326dc24
MD5 916d38e5f55e8a95ae1343395e1f4e9e
BLAKE2b-256 af970ad35bef5a138b4b142c4f1100e372244b0705fe2a4f11a94fca2e7ac326

See more details on using hashes here.

File details

Details for the file django_hexagonal_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: django_hexagonal_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.11 Linux/6.11.0-1018-azure

File hashes

Hashes for django_hexagonal_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0809a8fd85e0cd1e00a724418bd8cc03d4d88ca13c509e958299e89c37b0df83
MD5 66360a01e77e484f36851f311c1cc9c2
BLAKE2b-256 3dd6a91d85777ae4a9edcbba65dd5ac7ddbcbe2766dc9baed086061bafdd5d72

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