1👍
✅
0👍
You might want to preprocess the file.
Say make a cache while each word maps to the set of lines it contains so you can just fetch it and return them.
- [Answer]-How to access cookie and IP fields in DjangoRatings?
- [Answer]-Resolve user type in authentication in Django
- [Answer]-Django & WSGI – Import Error Can't find module django
- [Answer]-Django field lookup returns case-insensitive result even with __exact
- [Answer]-Static files not being served from seperate django staticfile application
0👍
You could get an initial request to kick off a thread to do the work of reading the file to a shared resource and return a 200 response immediately to the browser.
A Ajax poller on the client side can request periodically on a loop and pick up and display any new results in the resource until the file is read.
This is a quick and dirty approach and as @slider says an asynchronous framework is a better idea for long polling if your app relies on it a lot.
- [Answer]-Django: subsequent OR filter
- [Answer]-Django – redirect another client to a specific page
- [Answer]-Circular dependency? Reverse for 'home' with arguments '()' and keyword arguments '{}' not found
Source:stackexchange.com