V
V
vaaadimermolin2022-02-17 08:21:06
JavaScript
vaaadimermolin, 2022-02-17 08:21:06

How to implement a preloader in Django?

There is a function in views.py that is responsible for sending data to the 1c server via COM. The page loads in 10-15 seconds. How to make it so that during the loading of these 15 seconds, the page displays the message "Please wait." I tried all the articles, but they do not work as they should.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dr. Bacon, 2022-02-17
@bacon

The preloader should be done on js and django, it has nothing to do with it, well, the request itself, of course, should be sent via ajax.

V
Vladimir Kuts, 2022-02-17
@fox_12

You make the preloader visible on the page, hide the submit button, call an ajax request with data loading. On a successful callback, hide the preloader and unblock the submit button and display a message about a successful request. On failure - also hide the preloader and unlock the submit button and display a message about an unsuccessful request.
All this is done, of course - in javascript on the client side.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question