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.pyintobase.py,dev.py, andprod.py - 🔐 Auto-generate a
.envwithSETTINGS_PATHandENVvariables - 🧠 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
.envfile if it doesn’t exist - Set the
SETTINGS_PATH(e.g.,yourproject.settings.base) - Add
ENV=devwith a comment explaining how to switch to production - Auto-detect and optionally split
settings.pyinto 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.pyinto asettings/package - Create
base.py,dev.py, andprod.pyfor 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
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_autokit-0.1.3.tar.gz.
File metadata
- Download URL: django_autokit-0.1.3.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd5d48a62c14a7d65d32c2186ea3bccea51cf2fe24da01cb0e641b94785b22aa
|
|
| MD5 |
6dec11a275b35c3ecb6bb8a9925d100a
|
|
| BLAKE2b-256 |
d4af313f867d3ca4f6de72ac16a1009556bd3073842acd775509a26c06ae4f24
|
File details
Details for the file django_autokit-0.1.3-py3-none-any.whl.
File metadata
- Download URL: django_autokit-0.1.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79369b37dc0b58eb42a744d55bde9d9b72e36fb56f38f7cee0f57e86f2df3390
|
|
| MD5 |
092e7440ba9b1d63632ff26f9eadff90
|
|
| BLAKE2b-256 |
324c6e977862a9299c5c7effa47370db61edcfabc15ac016e66b5d720c76c418
|