Package: django-setup-cli
django-setup-cliDjango Setup CliIt takes time to start a Django Project and make it almost production ready. A developer needs to spend a lot of time
installing required libraries, setup database, setup cache as well as hiding secrets, configuresettingsfile.
With the help ofdjango-setup-clia developer can start analmost production readyproject in a minute.Requirementspython 3.6>Installation1. Create a virtual environment and activatewindowspip install virtualenv
 virtualenv venv
 <YOUR WORKING DIRECTORY>/venv/scripts/activateYour Current Working DirectoryUbuntu [Debian]sudo apt-get install python3-pip
sudo pip3 install virtualenv 
virtualenv venv 
source venv/bin/activateyou can use any name instead ofvenv2. Install django-setup-clipip3 install django-setup-cliUsagesHow to useUsage: django-cli [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  generate      Generates YAML File
  startproject  Starts Django Project1.startprojectOption 1:Similar todjango-admin startprojectIf there's no validsetup.yamlfile in your working directory
django-cli will take some input to start the projectTo Start a project use the following command in the shelldjango-cli startproject PROJECT_NAMENote: PROJECT_NAME is optional>> django-cli startproject ProjectName[Optional]

1. Project Name
Your Project Name: T

2. Install Necessary Libraries
Install Libraries [y/N]: y

1.Install djangorestframework [y/N]: y
2.Install graphene-django [y/N]: y
3.Install django-channels [y/N]: y
4.Install django-localflavor [y/N]: y
5.Install celery [y/N]: y
6.Install whitenoise [y/N]: y
7.Install django-filter [y/N]: y
8.Install django-extensions [y/N]: y
9.Install django-storages [y/N]: y

3. Static File
Create/Use Static File [y/N]: y

4. Template File
Create/Use Template File [y/N]: y

5. Media File
Create/Use Media File [y/N]: y

6. Setup Database
Setup Database [Skip To Use Default] [y/N]: y
1. postgresql
2. mysql
3. maria_db
4. oracle
5. mssql
6. sqlite3
7. django_cockroachdb

Database Engine: 1
Database Name: DATABASE_NAME
Database User: USER
Database Password: PASSWORD
Database Host: localhost
Database Port: 5432

7. Setup Cache
Install Cache [y/N]: y

1. pymemcache
2. redis
3. DatabaseCache
4. FileBasedCache
5. LocMemCache

Cache Engine: 2
Cache Location: LOCATIONAfter Providing required Information Your Project will be created and you will see following output1. Installing Required Libraries
installing django
...
...
2. Creating Source Directory
..
3. Creating Project File

Project Setup CompleteYour working directory will have the following files and foldersproject
│   README.md
│   .gitignore    
│   .env       [Django Secrets]
|   setup.yaml [django-cli YAML Setup Config File]  
└───src
   │   manage.py
   │   
   └───PROJECT_NAME
       │   asgi.py
       │   config.py
       │   settings.py   
       |   wsgi.py
       |   urls.pyNote: Do not delete.envfile, it will contain database, cache and django secret keysOption 2:1. Create asetup.yamlfilename:TEST_PROJECTlibraries:-django-rest-framework-celery-django-storagestemplate:truestatic:truemedia:falsedatabase:engine:postgresqluser:userpassword:passwordhost:hostport:portoption:config:psql.cfgcache:backend:redislocation:localhost:6532env:SECRET_KEY:YOUR_SECRET_KEY2. Rundjango-cli startprojectin terminal/shelldjango-cli startproject
# Your Project Will be created automatically using the setup.yaml fileUse Environment Variable insetup.yamlIt is possible to use secrets I.E [Database Password, Username, Secret Key] using environment variableTo Hide Secrets Usingenvironment variablecreate acli.envfile in the source directory
And do the followingcli.envMY_SECRET_KEY=<YOUR_SECRET_KEY>
DATABASE_USER=django_cli
DATABASE_PASSWORD=gonnaCry?setup.yamlTo use env secret Put$before your env variable
I.E$SECRET_KEYname:TEST_PROJECTlibraries:-django-rest-framework-celery-django-storagestemplate:truestatic:truemedia:falsedatabase:engine:postgresqluser:$DATABASE_USERpassword:$DATABASE_PASSWORDhost:hostport:portoption:config:psql.cfgcache:backend:redislocation:localhost:6532env:SECRET_KEY:$MY_SECRET_KEYYou can target a different env file using--envdjango-cli startproject NewProject --env spider.env2.generatedjango-cli generate PROJECT_NAME --env cli.envWill generatesetup.yamlfile, it will not create projectPROJECT_NAMEand--envare optional fields3.installdjango-cli installWill install required libraries also install libraries that are insiderequirements.txtfile@Creator and MaintainerKhan Asfi Reza