There is no way to do this without any client-side scripting, i.e. Ajax. You need something that will poll the server at regular intervals and show the answer to the user. There is a fragment that shows how this can be done.
Of course, to make this possible, you will also have to save the import itself on an autonomous process. This will do the import and record its progress somewhere regularly (in a file or in a database) so that Ajax can request it. A good way to do this might be to use celery , a Django-based distributed task queue.
Finally, you will need a simple view that will call Ajax, which will request a lengthy process (or view the created progress record) and report to the client.
So, pretty hard.
Daniel Roseman
source share