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)

⚙️ 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.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_autokit-0.2.0.tar.gz
  • Upload date:
  • Size: 7.7 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.0.tar.gz
Algorithm Hash digest
SHA256 83977db2467852634dc425bb0e99913c9ecc332c2decbd37a7fb13e5be25ea68
MD5 551d7c541cd5fa67a56068f781f6c64e
BLAKE2b-256 0e0ee00261b4571d3a116b43328cd6d10c0ca7465e89aedac07a5a4794209d55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_autokit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ed1804afe9cddde7046e7916c5d53dd67560fa02adb8016169515073b3990ce
MD5 609ab74d209c4635f88769883e5e4dbf
BLAKE2b-256 6f517c0c68033443a9fe2b2f310f886f3062a3ce981afa413df83b666b2282ac

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