A library to simplify Django project initialization
Project description
HiDjango
HiDjango is a Python library designed to simplify the initialization and setup of Django projects, enabling developers to create or configure Django projects with DevOps setups and database settings using simple commands.
Features
- Initialize new Django projects with a single command.
- Configure existing Django projects with DevOps and database settings.
- Automatically add Docker and Docker Compose files for development.
- Generate an
.envfile with theSECRET_KEYextracted from Django settings. - Configure databases (PostgreSQL or MySQL) with minimal effort.
- Easy-to-use CLI for managing Django projects.
What's New in Version 1.1.0
- Existing Project Configuration: Added the ability to configure existing Django projects with DevOps and database settings.
.envFile Generation: Automatically generates an.envfile for managing sensitive data likeSECRET_KEY.
Installation
To install HiDjango, use pip:
pip install hidjango
Usage
Creating a Django Project
To create a new Django project:
hidjango --init --name="project_name"
This command creates a new Django project with the specified name.
Configuring an Existing Django Project
To configure an existing Django project (e.g., adding DevOps files or setting up a database):
hidjango --config /path/to/project
Add DevOps Configuration
hidjango --config /path/to/project --devops
This adds the following files to your existing project:
Dockerfiledocker-compose.yml
If the database configuration already exists in the settings.py file, it will be included in the docker-compose.yml automatically.
Add Database Configuration
hidjango --config /path/to/project --db=postgresql
This command:
- Configures the database settings in the
settings.pyfile. - If
--devopsis also included, adds the database configuration to thedocker-compose.yml.
Full Configuration Example:
hidjango --config /path/to/project --devops --db=mysql
This performs:
- Adding Docker and Docker Compose files.
- Configuring MySQL as the database in both
settings.pyanddocker-compose.yml.
Adding DevOps Files to a New Project
To include Docker and Docker Compose files in a new project:
hidjango --init --name="project_name" --devops
This adds:
Dockerfiledocker-compose.yml
Generating .env File
HiDjango automatically generates an .env file in the project directory with the SECRET_KEY from settings.py. This ensures secure management of sensitive data.
Requirements
- Python 3.7 or higher
- Django 3.2 or higher
Example Commands
Full Setup for a New Project
hidjango --init --name="my_project" --devops --db=postgresql
Full Configuration for an Existing Project
hidjango --config /path/to/project --devops --db=mysql
Contributing
We welcome contributions! To contribute:
- Fork the repository on GitHub.
- Make your changes.
- Open a pull request.
For issues or feature requests, please open an issue on GitHub.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Links
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 hidjango-1.1.0.tar.gz.
File metadata
- Download URL: hidjango-1.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
305fa79eb36ad97d570000691ff9eaaf2f34c7332fd155829b62249c94480151
|
|
| MD5 |
f059cd193724cce3feb63aa62de09549
|
|
| BLAKE2b-256 |
ad336278f489ad7024c79c3744547e515398f0cc1515d9ea04040361fda88319
|
File details
Details for the file hidjango-1.1.0-py3-none-any.whl.
File metadata
- Download URL: hidjango-1.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82f8c41d29d3c512ac05b4118543637716bbce2bab5a92b991079acdb81bf6c3
|
|
| MD5 |
34dd96c3917a7fecbb9ba46d7223df38
|
|
| BLAKE2b-256 |
588c55cdf0c925b73bd5478f0276c59731fc7ce386ca55d39306c9469b72f4bf
|