Metadata-Version: 2.1
Name: django-structurator
Version: 1.0.0
Summary: django-structurator is an open-source CLI tool that streamlines and accelerates the setup of well-organized Django projects and apps, enabling developers to focus on building features instead of boilerplate.
Home-page: https://github.com/maulik-0207/django-structurator
Author: @maulik-0207
Author-email: maulikthumar784@gmail.com
Project-URL: Documentation, https://github.com/maulik-0207/django-structurator/blob/master/docs/README.md
Project-URL: Source, https://github.com/maulik-0207/django-structurator
Project-URL: Tracker, https://github.com/maulik-0207/django-structurator/issues
Keywords: django project-generator cli tool django-cli
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Framework :: Django
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django
Requires-Dist: inquirer

# django-structurator

`django-structurator` is an open-source CLI tool that streamlines and accelerates the setup of well-organized Django projects and apps, enabling developers to focus on building features instead of boilerplate.

## Features
- Create Django projects with a clean, advanced folder structure.
- Create Django apps with proper separation of concerns.
- Customizable project and app configurations based on user input.
- Automatically generates essential files, such as `.env.example` and `.gitignore`.

## Installation
Install django-structurator from PyPI:

```bash
pip install django-structurator
```

## Usage

django-structurator provides two main commands: `startproject` and `startapp`.

### 1. Create a Django Project

To create a new Django project, use the `startproject` command:

```bash
django-str startproject
```

The CLI will guide you through a series of prompts to configure the project:

- **Project Name**: Specify the name of your Django project.
- **Database choices**: Choose database from options like postgresql, mysql, sqlite, etc.
- **.env choices**: Choose .env configuration from options like django-environ, python-dotenv, etc.
- **Advanced Features**: Choose options like Django Debug Toolbar, SMTP Email, Django Jazzmin, Celery, DRF, Redis, etc.


#### Example Output
```bash
(venv) PS E:\> django-str startproject
[?] Enter project name: Test
[?] Enter project path: C:\Users\user\Downloads\Test
[?] Select database:
   postgresql
   mysql
 > sqlite

[?] Select ENV configuration:
   django-environ
   python-dotenv
 > no_env


ðŸ”§ Optional Project Features:
[?] Do you want to use Django Debug Toolbar? (y/N): y

// Other fetures

ðŸš€ Project Configuration Summary:
....

[?] Do you want to proceed with project creation? (Y/n): y                                                                         

Django project 'Test' created successfully in C:\Users\user\Downloads\Test

// success message
```

### 2. Create a Django App

To create a new Django app, use the `startapp` command:

**Note :** Run this command from location where your project's `manage.py` file is situated.

```bash
django-str startapp
```

The CLI will prompt you to configure the app:

- **App Name**: Specify the name of your Django app.
- **Additional Files Choices**: Choose files from options like validators.py, forms.py, signals.py, etc.
- **Additional Features**: Choose features from options like App level static & template folder, template tags/filters, etc.
- **Include API Support**: Optionally include basic API structure for the app.

#### Example Output
```bash
(venv) PS C:\Users\user\Downloads\Test\src> django-str startapp
[?] Enter App name: app1

ðŸ”§ Optional App Features:
[?] Do you want to use validators.py? (y/N): y

// Other fetures


ðŸš€ App Configuration Summary:
....

[?] Do you want to proceed with app creation? (Y/n): y                                                                                


ðŸŽ‰ Django app 'app1' created successfully!

// success message
```

## Project Folder Structure
Here is an example of the advanced folder structure generated by django-structurator:

```

{{ project_name }}/
â”‚
â”œâ”€â”€ docs/                     # Documentation files
â”‚   â”œâ”€â”€ ARCHITECTURE.md       # Project folder architecture guide
â”‚   â”œâ”€â”€ CHANGELOG.md          # Change log for the project
â”‚   â”œâ”€â”€ README.md             # Main documentation file
â”‚   â”œâ”€â”€ TROUBLESHOOTING.md    # Common issues and solutions
â”‚   â””â”€â”€ USAGE.md              # Instructions on using the project
â”‚
â”œâ”€â”€ local_db/                 # Local SQLite database for development
â”‚   â””â”€â”€ db.sqlite3
â”‚
â”œâ”€â”€ requirements/             # Dependency management
â”‚   â”œâ”€â”€ base.txt              # Core dependencies
â”‚   â”œâ”€â”€ development.txt       # Development-specific dependencies
â”‚   â”œâ”€â”€ production.txt        # Production-specific dependencies
â”‚   â””â”€â”€ test.txt              # Testing dependencies
â”‚
â”œâ”€â”€ src/                      # Main source code folder
â”‚   â”œâ”€â”€ apps/                 # All Django apps
â”‚   â”‚   â”œâ”€â”€ app-1/            # Example app
â”‚   â”‚   â”‚   â”œâ”€â”€ api/          # API for app-1
â”‚   â”‚   â”‚   â”‚   â”œâ”€â”€ v1/       # Version 1 of the API
â”‚   â”‚   â”‚   â”‚   â”‚   â”œâ”€â”€ __init__.py
â”‚   â”‚   â”‚   â”‚   â”‚   â”œâ”€â”€ serializers.py  # Serializers for API data
â”‚   â”‚   â”‚   â”‚   â”‚   â”œâ”€â”€ urls.py         # API URL patterns
â”‚   â”‚   â”‚   â”‚   â”‚   â””â”€â”€ views.py        # API views
â”‚   â”‚   â”‚   â”‚   â””â”€â”€ __init__.py
â”‚   â”‚   â”‚   â”œâ”€â”€ migrations/   # Database migrations
â”‚   â”‚   â”‚   â”‚   â””â”€â”€ __init__.py
â”‚   â”‚   â”‚   â”œâ”€â”€ templatetags/   # Custom template tags and filters
â”‚   â”‚   â”‚   â”‚   â”œâ”€â”€ __init__.py
â”‚   â”‚   â”‚   â”‚   â”œâ”€â”€ example_filter.py   # Custom filter example
â”‚   â”‚   â”‚   â”‚   â””â”€â”€ example_tag.py      # Custom tag example
â”‚   â”‚   â”‚   â”œâ”€â”€ __init__.py
â”‚   â”‚   â”‚   â”œâ”€â”€ admin.py      # Admin site configuration
â”‚   â”‚   â”‚   â”œâ”€â”€ apps.py       # App configuration
â”‚   â”‚   â”‚   â”œâ”€â”€ forms.py      # App-specific forms
â”‚   â”‚   â”‚   â”œâ”€â”€ models.py     # App models
â”‚   â”‚   â”‚   â”œâ”€â”€ signals.py    # Signal handlers
â”‚   â”‚   â”‚   â”œâ”€â”€ tasks.py      # Celery tasks
â”‚   â”‚   â”‚   â”œâ”€â”€ tests.py      # Unit tests
â”‚   â”‚   â”‚   â”œâ”€â”€ urls.py       # App-specific URL patterns
â”‚   â”‚   â”‚   â”œâ”€â”€ validators.py # Custom validators
â”‚   â”‚   â”‚   â””â”€â”€ views.py      # App views
â”‚   â”‚   â””â”€â”€ ...               # Additional apps
â”‚   â”‚
â”‚   â”œâ”€â”€ common/               # Shared utilities, constants, and helpers
â”‚   â”‚   â”œâ”€â”€ __init__.py
â”‚   â”‚   â”œâ”€â”€ constants.py      # Commonly used constants
â”‚   â”‚   â””â”€â”€ helpers.py        # Utility functions
â”‚   â”‚
â”‚   â”œâ”€â”€ config/               # Project configuration
â”‚   â”‚   â”œâ”€â”€ settings/         # Environment-specific settings
â”‚   â”‚   â”‚   â”œâ”€â”€ __init__.py
â”‚   â”‚   â”‚   â”œâ”€â”€ base.py       # Base settings
â”‚   â”‚   â”‚   â”œâ”€â”€ development.py # Development environment settings
â”‚   â”‚   â”‚   â””â”€â”€ production.py # Production environment settings
â”‚   â”‚   â”œâ”€â”€ __init__.py
â”‚   â”‚   â”œâ”€â”€ .env              # Environment variables
â”‚   â”‚   â”œâ”€â”€ .env.example      # Example environment variable file
â”‚   â”‚   â”œâ”€â”€ asgi.py           # ASGI configuration
â”‚   â”‚   â”œâ”€â”€ urls.py           # URL configuration
â”‚   â”‚   â””â”€â”€ wsgi.py           # WSGI configuration
â”‚   â”‚
â”‚   â”œâ”€â”€ media/                # Uploaded media files
â”‚   â”‚
â”‚   â”œâ”€â”€ static/               # Static files
â”‚   â”‚   â”œâ”€â”€ css/              # CSS files
â”‚   â”‚   â”œâ”€â”€ js/               # JavaScript files
â”‚   â”‚   â””â”€â”€ images/           # Image files
â”‚   â”‚       â””â”€â”€ favicon.ico   # Favicon
â”‚   â”‚
â”‚   â”œâ”€â”€ templates/            # HTML templates
â”‚   â”‚   â”œâ”€â”€ base.html         # Base HTML template
â”‚   â”‚   â””â”€â”€ index.html        # Homepage template
â”‚   â”‚
â”‚   â””â”€â”€ manage.py             # Django's management script
â”‚
â””â”€â”€ .gitignore                # Git ignore file
```

## Requirements
- Python 3.8+
- Django 3.2+

## Contributing
Contributions are welcome! If you'd like to contribute, please:

1. Fork the repository.
2. Create a new branch for your feature or bugfix.
3. Submit a pull request with a clear explanation of your changes.

## License
This project is licensed under the MIT License. See the [LICENSE](./../LICENSE) file for details.

---

Feel free to suggest features or report issues on our [GitHub repository](https://github.com/maulik-0207/django-structurator).
