Skip to content

Tag: django

Django Form does not save properly

I want to create a comment system. I can take username, doc_id, and comp_name, but I cannot get the comment_others. I think there is a problem saving the form. How can I fix it? views.py models.py forms.py template.html And there are two forms on the same page. When I save this form, the other form disappears…

Django: how to check a guest or a page owner entered the page

I am doing a social network, I have one profile template for all users, how to check a guest or a page owner entered the page, {% if profile.user.username == None%} tried to write like this in html but it works strangely.For users, I use the Profile model Answer try this https://docs.djangoproject.com/en/3.1/…

Celery is not loading tasks from one app out of five

I’m using autodiscover in my celery.py file for gathering tasks. Which up until a recently picked all of the app.tasks.py up, I’m not sure why but my config.tasks.py function are no longer being picked up, but all the other apps are. If I from “config.tasks import *” there are no error…

How to track download link in django?

I followed these method to track how much downloaded the file was. But total_downloads always remains same (it’s 0). How to increment total_downloads field by 1 after every download? My models.py: views.py. In this program, I want to increment the number of downloads. But it’s 0 in admin site. url…

why is day out of range?

i am trying to add a date to an application that I am writing. the apllication is actualy a list of activities. when i tried to add a datefield to the ui and save it into my database. i got this error this is my model this is my html page and this is my view i cant figure out