Regarding Django. When arranging the posts in the database in the order of creation (ID order), MySQL that is included by default is stored in the ID order in the local environment, so there was no particular difficulty.
However, after deploying with Heroku, MySQL cannot be used, so PostgreSQL will be used. The order of data in PostgreSQL is not the order of ID by default (update order? I still don't know how it is arranged), so you need to set it yourself.
I thought about going inside the database and setting the ORDER_BY clause there (probably this is the royal road), but I'm not used to it, so I added a code on Django's views.py, which is easier. By inserting ```ordering = ['id'] `` `, there will be no problem on the display.
views.py
class DataList(ListView):
template_name = "list.html"
model = DataModel
ordering = ['-id']
The character string enclosed in `''``` can write the name of the database field. If you want to sort in descending order, add
`'-'to the beginning as an option. You can use
"? "``` To make the order random.
What to do if Django sorts out of order Django v1.0 documentation model Meta options (https://djangoproject.jp/doc/ja/1.0/ref/models/options.html)