Metadata-Version: 2.4
Name: django-drfkit
Version: 0.1.0
Summary: A CLI tool for production-ready DRF scaffolding
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: typer
Requires-Dist: jinja2

# DRFKit

A powerful CLI tool for scaffolding Django REST Framework projects with a clean, production-ready architecture.



## Features

* **Instant Scaffolding:** Creates a scalable folder structure with `apps/` and `config/` directories.
* **Security First:** Auto-generates a cryptographically secure `SECRET_KEY` during creation.
* **Split Settings:** Pre-configured `base.py`, `dev.py`, and `prod.py` for better environment management.
* **DRF Ready:** Django REST Framework is installed and added to installed apps by default.
* **Clean Templates:** Generates `.env` and requirements files automatically.

## Installation

Install the package via pip:

```bash
pip install drfkit
```

*(Requires Python 3.8+)*

## Quick Start

### 1. Create a New Project

Run the following command to scaffold your project:

```bash
drfkit new project myproject
```

This creates the following structure:

```text
myproject/
├── config/
│   ├── settings/
│   │   ├── base.py
│   │   ├── dev.py
│   │   └── prod.py
│   ├── urls.py
│   ├── wsgi.py
│   └── asgi.py
├── apps/                  # Your apps go here
├── requirements/
│   └── base.txt
├── .env                   # Pre-filled with your secret key
└── manage.py
```

### 2. Run the Server

Navigate to your project and start the development server:

```bash
cd myproject
python -m venv venv
source venv/bin/activate  
pip install -r requirements/base.txt
python manage.py runserver
```

No extra configuration needed—it works out of the box!

## Usage

### Creating an App

DRFKit encourages a modular structure by placing apps inside the `apps/` directory.

```bash
drfkit new app myapp
```

This generates:

```text
apps/myapp/
├── __init__.py
├── admin.py
├── apps.py
├── models.py
├── serializers.py    # Ready for DRF
├── tests.py
├── urls.py
└── views.py
```

> **Note:** Remember to add `'apps.myapp'` to `INSTALLED_APPS` in `config/settings/base.py`.

## Configuration

### Environment Settings

* **Development:** By default, `manage.py` uses `config.settings.dev`. This is perfect for local coding.
* **Production:** To switch to production settings, set the environment variable:
  ```bash
  export DJANGO_SETTINGS_MODULE=config.settings.prod
  ```

### Secret Key

A unique `SECRET_KEY` is generated and placed inside `settings/base.py` automatically when you create a project. This ensures your local development is secure from the start.

## Contributing

Contributions are welcome! If you have ideas for improvement or find a bug, feel free to open an issue or submit a pull request.

## 👤 Author

**[Your Name]**
* GitHub: [[Oviyan](https://github.com/Oviyan007/)]
* Linkedin: [[Oviyan](https://www.linkedin.com/in/oviyan-s/)]
