https://github.com/abdelhadi92/sitech-django-inits
Environment tools for Django, used to set configuration depending on the server environment.
https://github.com/abdelhadi92/sitech-django-inits
Last synced: 3 months ago
JSON representation
Environment tools for Django, used to set configuration depending on the server environment.
- Host: GitHub
- URL: https://github.com/abdelhadi92/sitech-django-inits
- Owner: Abdelhadi92
- License: mit
- Created: 2019-11-14T00:25:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-14T00:26:18.000Z (over 5 years ago)
- Last Synced: 2025-01-18T00:14:41.597Z (5 months ago)
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Django Initialization Tool
Environment tools for Django, used to set configuration depending on the server environment.## Installation
Run the [pip](https://pip.pypa.io/en/stable/) command to install the latest version:
```bash
pip install git+https://github.com/sitmena/sitech-django-inits.git
```## Usage
- Go to the root of your project and create new directory called "__environments__".
- In "__environments__" directory create new file called "**\_\_init\_\_.py**".- In the "**\_\_init\_\_.py**" define the details of your environments in "**ENVIRONMENTS**" dictionary.
- Define the settings files
environments/__init__.py```bash
ENVIRONMENTS = {
'Development': {
'path': 'dev',
},
'Production': {
'path': 'prod',
},
}
```
environments/dev/settings_local.py```bash
DEBUG = TrueDATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'example',
'USER': 'root',
'PASSWORD': 'root',
'HOST': '127.0.0.1',
'PORT': '3306',
}
}
```
environments/prod/settings_local.py```bash
DEBUG = FalseDATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'example',
'USER': 'user1#$%^%',
'PASSWORD': '%$%23118',
'HOST': '54.1.4.62',
'PORT': '3306',
}
}
```
- Go to terminal and run the following command:
```bash
django-inits
```## Commands
```bash
django-inits
``````bash
django-inits --env=[Development] --overwrite=[no,yes,all]
```