Web development with Python Django is an exciting experience. As a beginner, though, I can vividly remember how challenging it was to set up my first ever Django project. Even getting the popular Django welcome page (shown below) was a “eureka” moment for me. In this shot, I will show you simple steps to do this very easily.
Have Python up and running on your machine and your favorite editor (be it Pycharm or VScode, either is fine).
Now make sure you have pip installed by executing the following command in the cmd:
Next, we create our virtual environment. We will call it
djangoenv. Remember to remain in this environment as long as we keep working on our project. This is a good practice that keeps our project dependencies away from other projects.
In our cmd, let’s execute the following:
python -m venv desktop/djangoenv
djangoenv, our virtual environment on the desktop.
To activate it and get it set to work, we change the directory to desktop and enter this command:
pip install django
This will install the latest stable version of Django. If you want a different one, indicate this by attaching the version number of interest to the Django command.
You can confirm the installation using this command.
django-admin startproject begin
beginfolder and the
python manage.py startapp minibegin
python manage.py runserver
ctrland clicking on the link to see the Django custom welcome page.
There you have it. Try to create more projects and apps to get used to the whole process.
View all Courses