When talking about calling, you have to talk about how the django architecture comes and goes. This is mainly the path of the url.py file and the call of the view.py file. In the folder of your website
[img]
/home/soyomo/images/2017-05-02 08-27-58 Screenshot.png
[/img]
In my file directory is the urls in the mysite folder. py file, when your website is working, first visit this path, and then according to the link in the file, visit the urls.py file in my godos_list folder, in this file there will be your view rendering path, in the webpage In the file there will be
{% load staticfiles %}
Tells you to call view static rendering. Having said that, let's get to the point. If you want to call the data of the database, you need to use the query set
//The simple understanding of the so-called query set is to filter the data you need from the database according to the query conditions 'Your class name'.objects.all()//This sentence means to query all objects 'Your class name'.objects.filter(id=1)//This sentence means to query the data whose id is equal to 1
// in view.py file def 'method name'(request)://define a method name return render(request, 'goods_list/pos.html', {})//This shows that this view renders the pos.html file def goods_list(request):// in the .py file are all in python language goods = Goods.objects.all()//Select all data filter_goods = Goods.objects.filter(type='fruit')//Data of selected fruits print(filter_goods)//This is displayed on the terminal, and the selected data is printed.
What is explained above is the call of the database, but if you want to know how the data called by the database is displayed on the website, you need the interaction between the front and the back and the knowledge of jquery.