Skip to content

shemanto27/One-Click-DRF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

heading image

One Click DRF (OCD) πŸš€

ΰ¦¬ΰ¦Ύΰ¦‚ΰ¦²ΰ¦Ύΰ§Ÿ README ΰ¦«ΰ¦Ύΰ¦‡ΰ¦²ΰ¦Ÿΰ¦Ώ ΰ¦ͺΰ§œΰ§‡ দেখুন এখানে (README.bn.md)

One Click DRF is a powerful CLI tool designed to bootstrap production-ready Django REST Framework projects in seconds.

PyPI version License GitHub Stars PyPI Downloads

πŸ› οΈ Technology Stack

Python Django Docker Terraform Ansible GitHub Actions Nginx

Coming Soon

Kubernetes Prometheus Grafana Azure Google Cloud

⭐ Star us on GitHub β€” your support motivates us a lot! πŸ™πŸ˜Š

Follow Shemanto Sharkar Share on LinkedIn


Stop copy-pasting code from old projects. Start with a solid foundation.

🌟 The Story Behind One Click DRF

Every time a new project starts at the office, I see a familiar cycle: developers need to start everything from scratch, from ground zero, through repetitive and manual work like this:

  • Repetitive Installations: Manually installing djangorestframework, django-cors-headers, drf-yasg(Swagger), and other essential packages every single time.
  • Settings Fatigue: Manually tweaking settings, creating .env files, and mapping them to variables.
  • The Hunt: Going to GitHub just to find a standard Python .gitignore.
  • Human Error: Forgetting something criticalβ€”like CORS settingsβ€”only to realize it hours later when the frontend developer can't connect.
  • Confidence Gap: Even after hours of setup, no one is 100% sure if the environment is truly "perfect" or "production-ready."

One Click DRF was born to solve this. It automates these repetitive tasks and guarantees a battle-tested, production-ready foundation in seconds. No more copy-pasting, no more forgotten settingsβ€”just one command to start building what actually matters.

πŸš€ What you get with ocd

When you initialize a project with ocd, you’re not just getting a folderβ€”you’re getting a full production environment:

  • 🐳 Docker Ready: Multi-stage Dockerfile and docker-compose.yml for development and production.
  • βš™οΈ CI/CD (GitHub Actions): Pre-configured workflows for automated testing, linting, and deployment.
  • πŸ—οΈ Infrastructure as Code (IaC): Terraform templates to manage your cloud resource effortlessly.
  • ☁️ AWS Deployment Ready: Built-in configurations to deploy your backend to AWS with confidence.
  • πŸ“Š Monitoring & Observability: Integrated Prometheus and Grafana setup to keep an eye on your app's health.
  • πŸ› οΈ Production Settings & .env: Professionally split settings.py and automatically generated .env file.
  • πŸ“ Swagger API Ready: Instant API documentation with drf-yasg so you're ready to test immediately.
  • πŸ“‚ Organized Apps Folder: A clean architecture where all your Django apps live in a dedicated apps/ directory.
  • πŸ”’ Standard .gitignore: A pre-configured, standard Python .gitignore so you don't have to find one.
  • πŸš€ GitHub Integration: Option to automatically initialize a git repo and push to a new GitHub repository in one go.

πŸ“¦ Installation

Since one-click-drf is a CLI tool, it is recommended to install it globally using uv:

uv tool install one-click-drf

If your system doesn't have uv yet, follow the installation guide here.

Alternatively, you can use pip:

pip install one-click-drf

πŸš€ Usage

Initialize a new project

ocd init myproject

This creates a new folder myproject with a production-ready structure.

Initialize in current directory

ocd init .

Enable Optional Features

You can mix and match flags:

ocd init myproject --docker --ci-cd

Or enable everything:

ocd init myproject --all

Check Version

ocd --version
# or
ocd version

Keep Your Package Updated

ocd update

🚩 CLI Flags

Flag Description
--docker Adds Dockerfile and docker-compose.yml
--ci-cd Adds GitHub Actions workflow for testing & linting
--iac Adds Terraform skeleton for AWS
--observability Adds Prometheus configuration
--all Enables all above features

πŸ“‚ Project Structure

We follow a clean, modular structure where the Django backend is isolated in its own directory, and infrastructure/deployment files are organized at the root:

project-root/
β”œβ”€β”€ backend/              # Django backend source code
β”‚   β”œβ”€β”€ core/             # Project configuration (settings.py, urls.py, etc.)
β”‚   β”œβ”€β”€ apps/             # Your Django apps live here
β”‚   β”œβ”€β”€ manage.py         # Django management CLI
β”‚   β”œβ”€β”€ .env              # Environment variables
β”‚   β”œβ”€β”€ .gitignore        # Backend-specific ignore rules
β”‚   β”œβ”€β”€ Dockerfile        # Backend container definition
β”‚   β”œβ”€β”€ erd.sh            # ERD generation utility
β”‚   └── requirements/     # Dependencies split (base, dev, prod)
β”œβ”€β”€ nginx/                # Nginx proxy configuration
β”œβ”€β”€ .github/              # CI/CD (GitHub Actions workflows)
β”œβ”€β”€ infra/                # Infrastructure as Code (Terraform & Ansible)
β”œβ”€β”€ monitoring/           # Observability (Prometheus/Grafana)
β”œβ”€β”€ docker-compose.yml    # Root orchestration for all services
└── DEVELOPMENT_GUIDE.md  # Detailed guide to get started

πŸš€ Built for the Future (Extensibility)

This structure is intentionally designed for scaling into a full-stack or microservices architecture:

  • Full-Stack Ready: Need a frontend? Simply add a frontend/ folder (React, Next.js, Vue, etc.) at the root.
  • Microservices/AI Ready: You can easily plug in other services like ml-service/ or ai-apps/ in their own folders next to the backend.
  • Simplified Orchestration: Any new service can be integrated into the root docker-compose.yml and CI/CD pipelines, ensuring your entire ecosystem remains easy to deploy in the cloud.

🀝 Contribution

We welcome contributions!

  1. Fork the repo.
  2. Clone it clearly.
  3. Install dependencies: uv sync or pip install -e .
  4. Add a new generator in one_click_drf/generators.py or new templates in one_click_drf/templates/.

βš™οΈ Configuration

On first run, ocd will ask for your GitHub and DockerHub usernames. These are saved in ~/.config/one-click-drf/config.toml so you don't have to type them again.


Back to Top

About

CLI tool for one click Production-ready Django REST Framework setup. . Considered app will deployed in AWS with CI/CD pipeline(GitHub Actions), Sentry Error tracking, Docker, Ansible, Terraform, Github

Topics

Resources

License

Stars

12 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors