N
N
NorthWind2562014-10-22 14:50:38
Django
NorthWind256, 2014-10-22 14:50:38

How to separate user and server side of a django project?

Good afternoon. A project is being developed in django.
The following situation has arisen:
The user is prompted to enter several data, after that he clicks on the "Confirm" button and the data is sent to the server, where their processing begins, it may take some time, about a minute. At this time, the user sees the same html page that was before entering and clicking on the "Confirm" button.
Actually, the question is how, after clicking on the "Confirm" button, display a separate html page to the user, and when the server processes the data, show him the results of the work?
I would appreciate any comments on this issue. Thank you!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
sim3x, 2014-10-22
@NorthWind256

How to make a form
https://docs.djangoproject.com/en/1.6/topics/class...
How to make a task for background processing
docs.celeryproject.org/en/latest/getting-started/f...
To show the result -- page refresh every X sec

B
bromzh, 2014-10-22
@bromzh

The easiest option is to load data with Ajax. When the Ajax request has not ended, display one information (configurable in jquery), when the Ajax has ended (i.e. the callback has been called) - render the results or redirect to the page with the results.
A difficult option is to use an asynchronous server with websockets, wait for the desired message on the client, upon arrival of which display the received data or redirect to the desired page.

R
Roman Sentyurev, 2014-10-22
@Aldaron1

You can give the user a template that will then pull up the data with AJAX.
Link to an example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question