Skip to main content

A CLI tool for production-ready DRF scaffolding

Project description

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:

pip install drfkit

(Requires Python 3.8+)

Quick Start

1. Create a New Project

Run the following command to scaffold your project:

drfkit new project myproject

This creates the following structure:

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:

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.

drfkit new app myapp

This generates:

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:
    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]

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_drfkit-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

django_drfkit-0.1.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file django_drfkit-0.1.0.tar.gz.

File metadata

  • Download URL: django_drfkit-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for django_drfkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 15e31603fd2406a6de10952257fa68ed27f7e8f1c073e15fa81f75d2e864205a
MD5 4314e74f67e35be3e11546562a9ada0a
BLAKE2b-256 a5a9652e99b4cdb71d68cfa49261638473232ee1de2af6272337e9e71fd0d388

See more details on using hashes here.

File details

Details for the file django_drfkit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: django_drfkit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for django_drfkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7476b5d50aa96f51ed9edc42501c0302943a1da5245f259be3deb16774940bc1
MD5 89198af94459d390933bc591ed62eacb
BLAKE2b-256 a5e235dfe7f6b51b91bfc651f7c4816f1b83de5eae6fc073b998a59ff7be7081

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