New method of app:
In the input command in the Terminal pycharm environment: Python manage.py startApp App Name eg: (newapp01)
Enter the URL 127.0.0.1:8000/ in the website? Urls first stage / the second stage to enter urls django
The App : { Apps : App information, Models : data on, views : own code (business logic), Test : Test}
app urls in the format:
from django.urls import path
from django.urls.conf import include
urlpatterns = [
path('/',include('.urls'))
]
app format of views:
from django.http import HttpResponse
def index(request):
return HttpResponse('')
Postman : analog front end request background
get and post differences
1.get different parameter passing mode and post
get request : page number + port + + django route add their own stuff
post request : page number + port + + django route add their own stuff
2.get request parameters unsafe
3.post request parameter encapsulated inside the body with respect to the get request safer
Only one request packet 4.get
There are two post request packet
There are two ways http request: get request, post a request
GET request format: http://127.0.0.1:8000/app1/index/?name=fado&password=123
POST request format : http: //127.0.0.1:? 8000 / app2 / login / name = fado & pwd = 123