I've digested various Django tutorials, but I'm getting tired of making projects first. So create a shell. The project name is unified as "config".
start_django.sh
#!/bin/sh
#Create & move working directory
mkdir $1 && cd $1
#Virtual environment construction
python3 -m venv venv
#Activate
source venv/bin/activate
#django installation
pip install django
#Project creation
django-admin startproject config .
Grant execute permission and execute with source. * Note that the directory will not be moved even if you execute it with sh.
$ chmod 755 django_start.sh
$ source ./django_start.sh <project_name>
Recommended Posts