Skip to main content

Create Django projects and apps with layered architecture.

Project description

Django Layered Start

Django Layered Start is a powerful CLI tool that helps you kickstart your Django projects by automatically creating a clean, SOLIDโ€‘compliant layered architecture. This package sets up your Django project and apps with separate layers for presentation, application, domain, and infrastructure, providing you with an organized and scalable foundation for your development.


๐Ÿš€ Features

  • Automated Project Setup: Instantly generate a new Django project using django-admin.
  • Layered App Creation: Create Django apps with a predefined folder structure:
    • Presentation: Contains view logic and URL configurations.
    • Application: Houses business logic and service layers.
    • Domain: Includes domainโ€‘specific utilities, selectors, and validators.
    • Infrastructure: Manages models and integration with external systems.
  • SOLID Principles: Ensures your code remains clean, maintainable, and scalable by following core SOLID design principles.
  • Interactive CLI Interface: A guided commandโ€‘line experience for setting up your project and apps without hassle.

๐Ÿ›  Installation

To install the package from PyPI, run:

pip install django-layered-start

Then start the CLI tool:

django-layered-start

๐Ÿ’ป Creating the Project & Apps

Follow the interactive prompts to scaffold your project:

๐Ÿ“ฆ Project name: myproject
โœ… Django project "myproject" created!

๐Ÿงฑ App name (or N to stop): accounts
๐Ÿ“‚ App "accounts" created with layered structure.

โ“ Do you want to add another app? (Y/N): Y
๐Ÿงฑ App name (or N to stop): products
๐Ÿ“‚ App "products" created with layered structure.

โ“ Do you want to add another app? (Y/N): N

๐Ÿ“ Project Structure

After running the CLI, your directory tree will look like this:

myproject/
โ”œโ”€โ”€ manage.py
โ”œโ”€โ”€ myproject/
โ”‚   โ””โ”€โ”€ settings.py
โ”œโ”€โ”€ accounts/
โ”‚   โ”œโ”€โ”€ presentation/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ views.py
โ”‚   โ”‚   โ””โ”€โ”€ urls.py
โ”‚   โ”œโ”€โ”€ application/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ””โ”€โ”€ services.py
โ”‚   โ”œโ”€โ”€ domain/
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ validators.py
โ”‚   โ”‚   โ”œโ”€โ”€ selectors.py
โ”‚   โ”‚   โ””โ”€โ”€ utilities.py
โ”‚   โ””โ”€โ”€ infrastructure/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ””โ”€โ”€ models.py
โ””โ”€โ”€ products/
    โ”œโ”€โ”€ presentation/
    โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ”œโ”€โ”€ views.py
    โ”‚   โ””โ”€โ”€ urls.py
    โ”œโ”€โ”€ application/
    โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ””โ”€โ”€ services.py
    โ”œโ”€โ”€ domain/
    โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ”œโ”€โ”€ validators.py
    โ”‚   โ”œโ”€โ”€ selectors.py
    โ”‚   โ””โ”€โ”€ utilities.py
    โ””โ”€โ”€ infrastructure/
        โ”œโ”€โ”€ __init__.py
        โ””โ”€โ”€ models.py

Django Layered Start gives you a robust, SOLIDโ€‘driven foundation from day one โ€” saving time and enforcing best practices in every app you build.

Contributing

Contributions are welcome! Feel free to fork the repository, create a new branch, and submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

Developed by Moataz Fawzy.

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_layered_start-1.2.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

django_layered_start-1.2.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file django_layered_start-1.2.2.tar.gz.

File metadata

  • Download URL: django_layered_start-1.2.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for django_layered_start-1.2.2.tar.gz
Algorithm Hash digest
SHA256 e2a1a53ea95e787075372423e423e26fac4209a5792d5f43ead7ec91ca519fc7
MD5 c39ebe251f2a014506c5fd16770071ec
BLAKE2b-256 4d123a9e5fdd93c49bbfe336ee451d8920dabdfd633ccc0967f34a323eea8b24

See more details on using hashes here.

File details

Details for the file django_layered_start-1.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_layered_start-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 25303cbaa6f4d0f37ed1535f0a539630247f3a658fe3191b2707fc174c86b8f5
MD5 9c97af5ab3e9d0dd8a669454ddad8e9b
BLAKE2b-256 1401c730445578a1e79e51db4f5bf90fcb5a19653ba023370e5638e6ed2547ae

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