3 ms·
I'm closer to a hobbyist than a professional dev, but the async views seem like a big functionality. Having done some Django apps, getting a synced up view for
by waihtis 6y ago
I'm closer to a hobbyist than a professional dev, but the async views seem like a big functionality. Having done some Django apps, getting a synced up view for some changing variable was always a bit painful.
- StavrosK 6y agoI'm not sure you're talking about the same thing, this is about asyncio/green threads.
- waihtis 6y agore-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/