Skip to content

Instantly share code, notes, and snippets.

@gonzalo123
Last active April 1, 2021 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gonzalo123/b3bdcff4c57a2818ca16e3158c97a59d to your computer and use it in GitHub Desktop.
Save gonzalo123/b3bdcff4c57a2818ca16e3158c97a59d to your computer and use it in GitHub Desktop.
Setting up django project from scratch
#!/usr/bin/env bash
# execute via “dot space dot slash” to avoid a subshell.
# for example: ". ./django.sh" instead "./django.sh"
echo "$(tput setaf 1)Creating new virtual environment ...$(tput sgr0)"
python -m venv venv
source venv/bin/activate
echo "$(tput setaf 1)Seting up django project ...$(tput sgr0)"
touch README.md
python -m pip install --upgrade pip
python -m pip install django
python -m pip freeze > requirements.txt
mkdir src && cd src
django-admin startproject config ./
python manage.py startapp app
python manage.py migrate
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment