A command-line tool to initialize a production-ready Django REST Framework project with one command.
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 upgradespip/setuptools/wheel. - 📦 Automated Dependencies: Installs
django,djangorestframework,djangorestframework-simplejwt,django-cors-headers,django-environ, andpillow. - ⚙️ Configured settings.py: Environment variable support with
.envloading, 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
.gitignorefile. - 📚 Generated Documentation: Provides a tailored
README.mdinside 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
- Search for "Edit the system environment variables" in the Windows Search Bar.
- Click Environment Variables....
- Under User variables, select
Pathand click Edit. - Click New and add your Python scripts folder (usually
C:\Users\<YourUsername>\AppData\Roaming\Python\Python314\Scriptsor similar). - Click OK to save, restart your terminal, and run
dj-shortcutsagain.
Local Installation & Development
To develop and test django-shortcut locally:
- Clone or download this repository.
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_shortcut-0.1.1.tar.gz.
File metadata
- Download URL: django_shortcut-0.1.1.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db29bce2ba4fa2cc252157749e27caea4e5a4106c95de3d15ddef02e2bf727dc
|
|
| MD5 |
0cc074fd48b5587c5976f14b5472ecd7
|
|
| BLAKE2b-256 |
fabf10ef90178d39c50f30a981f2bf29ead23f691aac2ce9ac05fde477e847a4
|
File details
Details for the file django_shortcut-0.1.1-py3-none-any.whl.
File metadata
- Download URL: django_shortcut-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fd3d38dd44571a7cfe2b067e94d1eff01fd213cebc32c83feeeb6ee8154a6cb
|
|
| MD5 |
8e27d44d563f0e84f14557e9024bb5a4
|
|
| BLAKE2b-256 |
551f3586d027e6dcaec7dd43f3e2e87984894aceedd761c92a62c74067e4841e
|