AmirMahmood

Results 8 comments of AmirMahmood

@jkupka You can use below code, Until docs be updated. ``` from channels.db import database_sync_to_async @database_sync_to_async def get_user(user_id): try: return User.objects.get(id=user_id) except User.DoesNotExist: return AnonymousUser() class QueryAuthMiddleware: """ Custom middleware...

@avallete, According to the [documentation](https://channels.readthedocs.io/en/latest/topics/databases.html#database-sync-to-async) `@database_sync_to_async` decorator cleans up database connections on exit. You can check this in the `@database_sync_to_async` [source code](https://github.com/django/channels/blob/e2d6d65a703e1aabf2f8d505183c135b4a777634/channels/db.py#L16).

@avallete, @SerhiyRomanov, @maxcmoi89 My pleasure. I created a PR for this issue. (#1442)

thanks for gist @frennkie, but According to the [documentation](https://channels.readthedocs.io/en/latest/topics/authentication.html#django-authentication), `AuthMiddlewareStack` can handle session based authentication itself. using default django session based authentication system is enough in my opinion.

@frennkie, yes. it's special case. I mentioned `AuthMiddlewareStack` for general scenarios, and for using session base authentication you must use a combination of ID, Token, etc ... to login user...

[این issue][1] احتمالا مشکل مشابه هست. میشه از fix همین issue استفاده کنیم یا اینکه همین JalaliDatePicker که به نظر گزینه خیلی خوبی هم هست رو جایگزین datepicker فعلی کنیم....

> در مورد انتخاب datepicker هر موردی که دوستان پیشنهاد کنن بگن میزاریم. فقط نکته اینه که باید تست بشه. اگه کسی بتونه در تست ها کمک کنه ممنون میشم....

> > پس به نظر اگه فعلا یک hotfix داشته باشیم برای رفع این مشکل با کمترین تغییرات بهتر هست تا کاربرهای قدیمی به مشکل نخورند. > > نکته اینه...