Skip to content

Tag: django

convert timestamp to date in custom commands

i am creating custom commands in django. i have a problem with conversion timestamp to date by methods like fromtimestamp. i have such error: line 13, in handle timest_conv = datetime.fromtimestamp(timest) OSError: [Errno 22] Invalid argument this is my class with handle Answer The timestamp is expressed in m…

Module ‘project_name’ has no attribute ‘celery’

I’m trying to set up a background task using celery and rabbitmq on django but I’m getting an error saying that my project has no attribute celery. I’m using PyCharm and installed celery through that. I’m new to celery but I’ve read a lot of articles similar to this issue (Attrib…

How to transfer data from one list to another in Django?

I’m doing a small to-to list, I’m stuck in views.py, there are to-do tasks, in-progress tasks and done tasks, I want to move a task from the to-do task list to the in-progress task list, I can’t figure out how to delete the data in the to-to task and make new data same as to-do task in the i…

Splitting dictionary objects

I am building a Blog App and I made a queryset which is showing blog date and likes of every day since blog date, But it is showing in dictionary and i am trying to show both instances differently in table like. Blog Date Likes 20 Sep. 6 Likes 21 Sep. 2 Likes 22 Sep. 4 Likes But it is