The first thing we need to do before initializing project with python is to set up virutal environment. Virtual Environment indicates . In other words, we are basically setting individual Python development environment per each projects independently.
Why would we need to do this? We need to install many packages while doing projects and if those packages have their own dependencies, an error would occur if package versions are different. Moreover, error can also occur when package versions collide with each other after upgrading or installing packages. In order to effectively control over these cumbersome things, it is recommended to set up virtual environment.
Pipenv is a combination of word of pip which is Python package managing tool and virtualenv which helps to create virtual environment.
Let's install Pipenv first.
pip install pipenv
Next, choose which version of Python you would like to use. All commands of Pipenv are at here (opens in a new tab).
For me, I used the most recent version of
3.11 as of July 2023.
pipenv --python 3.11
Next, install necessary packages (opens in a new tab) with using
pipenv keyword. Before install packages, make sure you install packages under the project root folder.
mkdir letshcd letshpipenv install django
Poetry (opens in a new tab) is another Python package manage tool.
I found out that Poetry takes too much slow speed when downloading certain packages1. Therefore, I ended up choosing to use Pipenv for this project.
Install Poetry with curl.
curl -sSL https://install.python-poetry.org | POETRY_HOME=/etc/poetry python3 -
Next, navigate to project root folder and create
.lock file with the following command.
mkdir letshcd letshpoetry init
And we can install Django now.
poetry add django
I decided to use React with TypeScript, and used Vite (opens in a new tab) for making boilerplate.
Create React App (opens in a new tab), which I used to use quite often, installed too many unnecessary packages that makes my project heavier and it didn't allow me to customize the packages that I want.
We can create project by using the following command (opens in a new tab).
As I will be using React with TypeScript, I included
react-ts command keyword.
pnpm create vite letsh --template react-ts
What is PNPM?2 PNPM은 NPM