<aside> 😎 Note Taking created by Alejo Ríos. Based on the book Django For Impatient 4 by Daniel Correa.
</aside>
First of all, we assume that we already have installed on our machine the latest version of Python:
python3 --version
Also, the latest version of pip
:
pip3
Having this, we are going to install Django with pip
and also inside a Python Virtual Environment.
python3 install Django==4.0
To ensure that Django is install:
python3 -m django
This should print a lot of commands to use with Django.
Now, is time to create the Django project, running the following command:
python3 -m django startproject <project_name>
Take into account that the name of the project should not have hyphens, only underscores. Following the good practices of Python.
In the terminal, change to the project directory. Inside there, run the following command:
python3 manage.py runserver
This will start a local web server on your machine, in a URL like this: http://127.0.0.1:8000/
. Open the link in a browser and you will see the default landing page.