3 ms·
re-read the documentation but I'm not following. This example: async def current_datetime(request): now = datetime.datetime.now() html = '<html><
by waihtis 6y ago
re-read the documentation but I'm not following. This example:
async def current_datetime(request):
now = datetime.datetime.now()
html = '<html><body>It is now %s.</body></html>' % now
return HttpResponse(html)
seems like an example that I was thinking of.
- StavrosK 6y agoI don't know what you're thinking of, unfortunately, but that piece of code just returns the current date when you visit the page.
- waihtis 6y agoAfter taking a uninterrupted reading slot to understand the async views, you're right, and I had the concept understood wrong.
- StavrosK 6y agoYeah, I think you were thinking some sort of auto-refresh.
- waihtis 6y agoThat was exactly what I was hoping this to be.
- arusahni 6y agoPerhaps django-reactor would be of interest to you? [1] It's targeting LiveView-like functionality for Django. I haven't used it (so I can't vouch for the claim). 1: https://pypi.org/project/django-reactor/ https://pypi.org/project/django-reactor/