Hacker News new | past | comments | ask | show | jobs | submit login

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.



I'm not sure you're talking about the same thing, this is about asyncio/green threads.


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.


I don't know what you're thinking of, unfortunately, but that piece of code just returns the current date when you visit the page.


After taking a uninterrupted reading slot to understand the async views, you're right, and I had the concept understood wrong.


Yeah, I think you were thinking some sort of auto-refresh.


That was exactly what I was hoping this to be.


Perhaps 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/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: