Last active
April 1, 2021 10:49
-
-
Save gonzalo123/b3bdcff4c57a2818ca16e3158c97a59d to your computer and use it in GitHub Desktop.
Setting up django project from scratch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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