Skip to main content

A CLI tool to bootstrap a production-ready Django REST Framework project in seconds.

Project description

Django Shortcut (django-shortcut)

A command-line tool to initialize a production-ready Django REST Framework (DRF) project with a single command.

This tool automates the process of setting up a virtual environment, installing essential dependencies, configuring standard environment variables with .env, and establishing base configurations.


Features

  • 🐍 Virtual Environment (venv): Automatically sets up, activates, and upgrades pip/setuptools/wheel.
  • 📦 Automated Dependencies: Installs django, djangorestframework, djangorestframework-simplejwt, django-cors-headers, django-environ, and pillow.
  • ⚙️ Configured settings.py: Environment variable support with .env loading, integrated CORS headers, preconfigured static/media root directories, and standard environment-based database configuration.
  • 🔐 Authentication: Out-of-the-box JWT configuration with djangorestframework-simplejwt.
  • 🔧 Git Integration: Initializes a Git repository and sets up a standard .gitignore file.
  • 📚 Generated Documentation: Provides a tailored README.md inside your new project folder with instructions to run and test.

Installation

You can install django-shortcut directly from PyPI:

pip install django-shortcut

Usage

Create a new Django DRF project in a single command:

dj-shortcuts my_project_name

(or django-shortcuts my_project_name)

Options

  • project_name (Required): The name of your new Django project. Must be a valid Python identifier (no hyphens - or dots .).
  • -t, --target (Optional): Specify a custom folder path where you want the project created. If not provided, it creates a folder named after the project in your current directory.

Example:

dj-shortcuts ecommerce_api -t C:\Users\mahed\Documents\projects\ecommerce_api

Troubleshooting

Windows: Command not recognized

If you run dj-shortcuts and get the error: 'dj-shortcuts' is not recognized as an internal or external command...

This means Python's user scripts folder is not in your system PATH variable. You can solve this in two ways:

Option A: Run directly with Python (Immediate)

You can bypass the PATH configuration by invoking the module directly:

python -m django_shortcuts.cli my_project_name

Option B: Add Python Scripts directory to your PATH

  1. Search for "Edit the system environment variables" in the Windows Search Bar.
  2. Click Environment Variables....
  3. Under User variables, select Path and click Edit.
  4. Click New and add your Python scripts folder (usually C:\Users\<YourUsername>\AppData\Roaming\Python\Python314\Scripts or similar).
  5. Click OK to save, restart your terminal, and run dj-shortcuts again.

Local Installation & Development

To develop and test django-shortcut locally:

  1. Clone or download this repository.
  2. Install the package in editable mode from the project root:
    pip install -e .
    

License

This project is licensed under the MIT License.

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_shortcut-0.1.2.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

django_shortcut-0.1.2-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file django_shortcut-0.1.2.tar.gz.

File metadata

  • Download URL: django_shortcut-0.1.2.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for django_shortcut-0.1.2.tar.gz
Algorithm Hash digest
SHA256 599ae3add5adbd7e481a67a977982b6fb92d568051d598d05560cdafd1ce20c2
MD5 51f2cee4947ca9ca908ab85e9ced0423
BLAKE2b-256 0b67c2a8167c8a20bb598d4c1b65277cc2525b1244b19d5abd1ff22d50bc74d2

See more details on using hashes here.

File details

Details for the file django_shortcut-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_shortcut-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 55b0a42a0de91e30148f09997c949e7d8efad5f53e9b4cf757c996b922e9208f
MD5 d4c228030ab28bfa741583d28c3e9bed
BLAKE2b-256 b663896123b3ee5843dd2cc928e87e970d42fd35f8179b03a2b56cdb7f45dbb6

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