1
00:00:00,200 --> 00:00:03,980
Hey, welcome to the first video where we will start our app.

2
00:00:03,980 --> 00:00:07,310
So let's start the fun with coding in Python.

3
00:00:07,310 --> 00:00:14,630
We'll begin by creating a QR code image, so there are other tools to do that.

4
00:00:14,630 --> 00:00:17,240
But we'll do that with Python because why not?

5
00:00:17,270 --> 00:00:18,320
It's very easy.

6
00:00:18,320 --> 00:00:26,660
So just creates a python project where we will create both the QR image and also the Django app.

7
00:00:26,660 --> 00:00:30,500
So this is my empty project and I'll create.

8
00:00:32,220 --> 00:00:33,840
A keyword.py file.

9
00:00:33,840 --> 00:00:42,150
So this will contain the code which will generate a QR code and that QR code, when scanned with a mobile

10
00:00:42,150 --> 00:00:48,240
device, it will open the URL to our project to create QR codes.

11
00:00:48,240 --> 00:00:49,020
With Python.

12
00:00:49,020 --> 00:00:51,930
You want to use the QR code library.

13
00:00:54,360 --> 00:01:00,780
I just selected my interpreter here because it was not selected by PyCharm by default.

14
00:01:00,780 --> 00:01:04,620
So now Python 3.11 is my python interpreter.

15
00:01:04,980 --> 00:01:07,530
So now I can install QR code.

16
00:01:07,530 --> 00:01:11,010
So open the terminal, make sure that Venv is activated.

17
00:01:11,010 --> 00:01:18,900
You see these parentheses here with Venv inside and then run PIP install QR code.

18
00:01:22,450 --> 00:01:24,220
We also need another library.

19
00:01:24,700 --> 00:01:25,960
It's called Pillow.

20
00:01:26,290 --> 00:01:28,900
This is an image processing library.

21
00:01:29,860 --> 00:01:30,490
Sorry.

22
00:01:30,520 --> 00:01:31,840
Pip install pillow.

23
00:01:32,470 --> 00:01:41,260
This is an image processing library, so QR code needs that library to be able to process the QR code

24
00:01:41,260 --> 00:01:43,720
image even though we don't install it.

25
00:01:43,720 --> 00:01:47,440
It's used on the background by QR code.

26
00:01:47,440 --> 00:01:49,060
So QR codes.

27
00:01:49,060 --> 00:01:59,050
And then you want to create an image with QR codes dot make and here is where you pass the URL which

28
00:01:59,050 --> 00:02:05,980
you want to open when the user scans that generated QR code.

29
00:02:05,980 --> 00:02:15,760
So in our case that would be 127.0.0.1 colon 8000.

30
00:02:15,790 --> 00:02:17,850
Why is it this one?

31
00:02:17,860 --> 00:02:26,050
Because locally when we run our Django project, the app will be accessed on this URL.

32
00:02:26,080 --> 00:02:34,280
Now, when you deploy your app, you want to come back to this piece of code and then just change this

33
00:02:34,280 --> 00:02:38,000
to the actual domain, to the public domain you have.

34
00:02:38,000 --> 00:02:43,550
And then you want to run this code again and you'll get a new QR code that will be the QR code you want

35
00:02:43,550 --> 00:02:45,680
to give to the restaurant, to your client.

36
00:02:45,680 --> 00:02:46,730
So you are the programmer.

37
00:02:46,730 --> 00:02:52,820
Perhaps a restaurant is your client, so you want to give them that QR code so then they can give that

38
00:02:52,820 --> 00:02:55,370
QR code to restaurant customers.

39
00:02:56,480 --> 00:03:01,280
So that will create an image object, but it's just a python object.

40
00:03:01,280 --> 00:03:05,570
It is existing in the python domain.

41
00:03:05,570 --> 00:03:06,650
In the interpreter.

42
00:03:06,650 --> 00:03:11,060
You want to create a file out of that, an image file.

43
00:03:11,060 --> 00:03:17,720
So to do that you want to do image dot save QR dot PNG.

44
00:03:18,050 --> 00:03:20,810
So that will be the name of the file.

45
00:03:20,810 --> 00:03:22,910
Now I can run this code.

46
00:03:24,720 --> 00:03:26,760
And there is the QR code.

47
00:03:26,760 --> 00:03:28,890
So that's an image file.

48
00:03:29,040 --> 00:03:36,390
If you scan it with your mobile phone, it will take you to this URL, right?

49
00:03:36,600 --> 00:03:40,260
That's about creating QR codes in Python.

50
00:03:40,260 --> 00:03:43,710
So with that, we're ready to build our Django app.

51
00:03:43,740 --> 00:03:44,730
I'll see you in the next video.

