skip to Main Content

Mongodb – pymongo count_doucment() not working with datetime

Hi i am trying to query data from mongodb using python = 3.8, django=4.2.2, arrow==1.2.3 pymongo = 3.13.0, mongodb is serverless. this is my filter object filter['created_at']={ '$gte': arrow.now(settings.LOCAL_TIME_ZONE).shift(hours=-24).span('day')[0].to(settings.TIME_ZONE).datetime, '$lt': arrow.now(settings.LOCAL_TIME_ZONE).span('day')[1].to(settings.TIME_ZONE).datetime, } when i print filter['created_at'] i get output as…

VIEW QUESTION

Can't connect to mysql with Django inside docker

I am trying to start django project using MySQL and Docker to containerize it. But get an error. Here is it's traceback: testcasebooks-backend-1 | Traceback (most recent call last): testcasebooks-backend-1 | File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 289, in ensure_connection testcasebooks-backend-1 | self.connect()…

VIEW QUESTION
Back To Top
Search