Skip to main content

A command-line tool to initialize a production-ready Django REST Framework project with one command.

Project description

Django Shortcuts (django-shortcuts)

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 dependencies, configuring settings (including database environment variables, CORS, and SimpleJWT authentication).


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, and preconfigured static/media root directories.
  • 🔐 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.

Local Installation & Development

To develop and test django-shortcuts locally:

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

Now, the dj-shortcuts and django-shortcuts commands will be available globally on your system path.


Usage

Create a new Django DRF project in a single command:

dj-shortcuts my_api_project

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

Publishing to PyPI

To upload this tool to your PyPI account so you can install it anywhere via pip install django-shortcuts (or similar package name):

1. Install Build Tools

Make sure you have build and twine installed in your global python or target environment:

pip install build twine

2. Build the Package

From the root of the django-shortcuts directory (containing pyproject.toml), run:

python -m build

This generates a source distribution (.tar.gz) and a wheel file (.whl) inside the dist/ directory.

3. Upload to PyPI

Upload the distributions to PyPI:

python -m twine upload dist/*

Note: You will be prompted to enter your PyPI token/credentials.


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.0.tar.gz (9.6 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.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_shortcut-0.1.0.tar.gz
  • Upload date:
  • Size: 9.6 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.0.tar.gz
Algorithm Hash digest
SHA256 65a913199579c60a08444353fab9db6c624821b26169dbd068a42b758e1f8b5f
MD5 fe7c54aa28fd39e51330f1eae2c19df4
BLAKE2b-256 65b90897499ea40e94e41b42a19fc3877e032f1a1860697d466d2599ccfdaa57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_shortcut-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1105a2871ff17320c0bff8526d98691ab5473f9dc348dd953009fde102ee9380
MD5 dc24905ffdf40e45fca88fabb6d95b7b
BLAKE2b-256 da165e1eda68aedcc1e12d25cf201dc7164622be2262c206ffbf81008e2b52e0

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