Skip to main content

A CLI tool to automate Django project setup, including settings splitting, .env creation, and app boilerplate.

Project description

Django Autokit

Django Autokit is a CLI tool that automates the setup and maintenance of Django projects. It simplifies common tasks like environment variable setup, splitting settings into base.py, dev.py, and prod.py, generating .env files, and creating boilerplate apps — saving you time and effort when starting or scaling projects.


✨ Features

  • 📁 Split settings.py into base.py, dev.py, and prod.py
  • 🔐 Auto-generate a .env with SETTINGS_PATH and ENV variables
  • 🧠 Automatically add new apps to INSTALLED_APPS (supports both flat and modular settings)
  • 🔄 Compatible with Django 4.x and 5.x

📦 Installation

pip install django-autokit

🚀 Usage

Once installed, use the djkit CLI tool to run commands.

To see all available commands:

djkit --help

1️⃣ Initialize Autokit

In the root of your Django project, run:

djkit init-env

This will:

  • Create a .env file if it doesn’t exist
  • Set the SETTINGS_PATH (e.g., yourproject.settings.base)
  • Add ENV=dev with a comment explaining how to switch to production
  • Auto-detect and optionally split settings.py into modular settings

2️⃣ Split Settings Manually (Optional)

If not already split, you can do it manually with:

djkit split-settings

This will:

  • Move your current settings.py into a settings/ package
  • Create base.py, dev.py, and prod.py for better configuration separation

3️⃣ Create a Django App

To generate a new app and automatically register it in INSTALLED_APPS:

djkit startapp blog

This will:

  • Run django-admin startapp blog
  • Automatically insert 'blog' into your settings (flat or modular)

4️⃣ Gitignore Generator

To generate a Django-friendly .gitignore file:

djkit gitignore

⚙️ Environment Management

Your .env file will look like this:

# Path to your Django settings file (use base.py for split settings)
SETTINGS_PATH=yourproject.settings.base

# Set ENV to 'prod' when deploying to production
ENV=dev

📁 Example Project Structure

yourproject/
├── manage.py
├── .env
├── yourproject/
│   ├── settings/
│      ├── base.py
│      ├── dev.py
│      └── prod.py
│   └── __init__.py
├── blog/
│   └── __init__.py

✅ Compatibility

  • ✅ Django 4.x
  • ✅ Django 5.x
  • ✅ Python 3.7+

🛡 License

This project is licensed under the MIT License – see the LICENSE file for details.


🤝 Contributing

Pull requests are welcome! If you find a bug or have a feature request, feel free to open an issue.

See full Changelog.

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_autokit-0.2.1.tar.gz (8.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_autokit-0.2.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file django_autokit-0.2.1.tar.gz.

File metadata

  • Download URL: django_autokit-0.2.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for django_autokit-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fe88f2de731f43ea0ded1817f641677aea7dd1ec7524191b875f24db64230066
MD5 504496be12584d1463f85406b011747f
BLAKE2b-256 1651edda2ecbd6546115fefc9f1d7712271bdc2df23dd079532352bad653abe8

See more details on using hashes here.

File details

Details for the file django_autokit-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: django_autokit-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for django_autokit-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f518a87d5a82a7b5d4ab5a4aa300f07fd97008569701897c33314afa91f1bd16
MD5 7d881008ce547c89928dfbfda2f8b33b
BLAKE2b-256 a2f660eee7ebba0b0763db83b38f9f405f370c94acd5de9640c38e035010bcbb

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