PowerShell script for creating a Django project

I made a simple PowerShell script for all of those Windows users out there for creating a Django project. I used it myself on several occasions and maybe in the future we could incorporate the same logic into adding a new command to django-admin:

$workingdir = $args[0]

# Create and go to working directory
mkdir $workingdir
Set-Location $workingdir

# Create Python virtual environment
python -m venv ./env

# Create requirements.txt and install its contents
Set-Content .\requirements.txt @"
pip install -r requirements.txt

# Create the project
django-admin startproject config .
1 Like