Complete Django for Production - Setting up the development environment (Part 1/6)
We are kicking off the Complete Django for Production guide series with setting up our development environment.
We are kicking off the Complete Django for Production guide series with setting up our development environment. This step is important so that (a) everything will work and (b) we all have the same base conditions. If questions arise, let us know in our Discord community, and we will address and clarify them.
In the following steps, we will install the following:
Python
Two python packages (django + cookiecutter)
Docker
IDE
Python
We do need Python for the generation of the initial project and some management commands later on. If you already have Python 3 on your system, move on to the packages.
Installing Python 3
We are expecting you to know how to install a simple binary. After all, you already have some django experience! Download Python for your OS and install it.
Required Python packages
Install the following two packages via pip. django for obvious reasons and cookiecutter will be required to generate the project's initial code scaffolding.
# if your python 3 installation's pip is called pip3:
pip3 install django
pip3 install cookiecutter
# if it just called pip:
pip install django
pip install cookiecutter
Docker
Our local development setup will also run inside a Docker environment. Get Docker from the official site. For Windows or Mac, download and install Docker Desktop.
For Windows, we highly recommend using the WSL2 backend, as we encourage to user the WSL2 shell for all future commands. Follow the official instructions for that. If you are running into troubles, ask for help in our Discord community.
For Linux, you are fine by just installing the Docker engine (we don't need the UI). However, we recommend installing Docker via your distro's package manager (pacman, apt, etc.). You are a Linux user, you know how to do that.
IDE (Integrated Development Environment)
This is where you write your code and largely boils down to preference. Personally, we at dacxquad use Jetbrain's PyCharm Professional (free professional edition is available for students) as it allows us to connect to the Docker containers for indexing (meaning it "knows" all the packages that are installed in the Docker container, and we don't have to install them locally). The free version is fine also, but does not come with the capability to connect to the Docker container.
An honorable mention goes out to VS Code, which is technically not an IDE, but an extendable editor. Will work as well. Use whatever you are comfortable with.