This video covers Part 1: Requests and Responses of section “Getting Started” from the Django Documentation.
00:00 – Introduction
Model View Template structure
00:17 – django MVT architecture
Here we are seeing into a little bit more detail about Django’s MVT structure. I try to make it simple and easy to understand such modern architecture of Model – View – Template.
How to use requirements.txt
01:50 – requirements.txt of virtualenv
A further step on how effectively using virtualenv. In this section we are talking about how to “backup” and “restore” or better said “cloning” a virtual environment from one machine to set up onto another. This is to ensure that everybody is using the same “tools” for a Django project.
Let’s start our django tutorial
09:55 – Part 1: Requests and Responses
Okay, now we actually start our journey “Getting Started” of the Django Documentation.
10:48 – Checking Django version
The command to use is: “python -m django –version”
Creating “mysite” project
12:03 – Creating a project
Command: “django-admin startproject mysite”
Above command will automatically create a django project for you. By that, it will also create a folder named “mysite” within the directory of your choice.
14:05 – Source code location
“mysite” is the directory that holds your source code of the web app. It’s safer to place your source code outside of the website’s root document.
15:25 – Project’s directory structure
The mother-folder “mysite” contains a child-folder also named as “mysite”. Confusing? If you don’t like that default structure you may rename the (outer) mother-folder to any name of your choice, e.g. source, src… Please notice not to rename the (inner) child-folder.
Django’s Development Server
17:30 – The development server
One convenient point of Django is its Development Server that come with it by default. You don’t have to dirty your hands with working on real servers at the developing stage. However, don’t use Django’s Development Server as your real production environment, it’s not made for this.
Creating Django apps
23:23 – Creating the Polls app
Command: “python manage.py startapp polls”
That will create an app named “polls” for your project “mysite”. Also it will create a folder “polls” for you.
29:13 – Write your first view
Now we are touching the MVT structure. Writing our first view.
Creating a manual URL
32:30 – Creating polls/urls.py
Creating the urls.py file for “polls” app.
34:18 – Pointing root URL in mysite/urls.py
Allocating our “polls” app on the “mysite” project.
39:03 – Verify that Polls app is working
http://localhost:8000/polls if everything’s done right, than you’ll see it working well.
41:02 – path() arguments
Okay, it’s time to get some light headache about what those arguments are. For now, just read to know those thing, later you will get familiar with arguments (or not?)
45:43 – Thanks and see you in the next video.
More on topic “Django Documentation, Getting Started”
This series can be found on: https://viws.net/category/django4beginners/
You may go to my YouTube Channel for more videos: https://www.youtube.com/channel/UC6JVvyI4k6zzh9vJNhRClRw