Django 2 "Make New PAGE !"
Now we know how to start off and make the webpage. This time I'm going to show you how to make new page !
You see the address "127.0.0.1:8000" , what if it moves on to the other page ? like 127.0.0.1:8000/login, 127.0.0.1:8000/main, 127.0.0.1:8000/post.
("/" shows where it goes next)
we already have path into urls.py under mysite
' ' this blank means we just put in this main URL, bring us to whatever page we define next comma.
'' -> 'main.urls'
Now in main folder you see this
it means if we don't type anything after address, it goes path views.index
Let's make another path like this
it means if type a1 (127.0.0.1:8000/a1) it goes view.a1
"Main -> views.py"
we already have this function from last time
Now we're going to make new function since we made another path on main.urls
in Main -> views.py , I add one more function like this
Let's save and go to the webpage again.
on 127.0.0.1:9090 , you see "Welcome to my world"NEXT, let's move to 127.0.0.1:9090/a1
You see "This is a1", which is the function we made on view.py / main
The bottom line; we can designate the path; mysite urls.py -> main urls.py -> main views.py -> on the screen