ERMIA
Also tried with ajax request?
Dan
No errors in console?
No, know I changed something and it work with db but always work only one button or like or unlike
ERMIA
I think instead of .exist yoy should check like that req.user in post.likes
Dan
So when user click on button like or add to dB or remove. So it's work. But buttons name don't changed (like/unlike) so "if" don't work at fact
Dan
I think instead of .exist yoy should check like that req.user in post.likes
User can't see post of he isn't request. So I don't sink it need
ERMIA
So when user click on button like or add to dB or remove. So it's work. But buttons name don't changed (like/unlike) so "if" don't work at fact
I think you need to many to many field likes and dislikes When you did nothing it has no idea if you liked or disliked
ERMIA
It this case you should use ajax request not form Cause redirecting for like is nonsense*
ERMIA
I don't know about Ajax. Thanks I will try to
It's easier to add vue or alpine for event controlling, And using axios or fetch for request, And you need to implement the logic in a simple and small api
ERMIA
https://postsrc.com/posts/how-to-make-ajax-request-in-alpine-js#:~:text=To%20perform%20the%20Ajax%20in,have%20defined%20on%20the%20data. Here is an example
ERMIA
Warmest thanks!
🌺🌺🌺🌺🌺🌺
Вячеслав
Hi. Celery question. In our project we have some periodic tasks - everyday transactions particularly. Every morning some function checks if it needs to make a transaction. There is a bug somewhere that I was told to fix, The question is - how do you usually debug such periodic tasks? I can test particular functions in this pipeline but can't find a bug there. I want to test this feature entirely and of course don't want to wait a few days.
Вячеслав
Yeah, I know. Is there any way to somehow trigger periodic task as if it happens "in its habitat"? Make celery think it's the next day, for example
Anonymous
Hello, best way to add drop-downs in my model for locations related fields?something like after selecting a country, the cities fields only shows those that are available at the selected country?
Km
…I must hit my head, I should let AUTH_USER_MODEL = what I would like to authenticate. 0.0
Just know the thing that how to use the pbkdf2_sha256 to encrypt the raw password 🤣
Stanislav
why we pass request to render fucntion?
Sandip
Modify the User model to include those fields and check how to utilize USERNAME_FIELD in django BaseUserModel
I have changed USERNAME_FIELD but i want to change password field to otp, means if user fill his mobile number then an he gets an OTP and on the basis of OTP he should login, in short mobile no as username & OTP should it's password
Anonymous
Any one have how to connect Mongodb to django connection
Doragonsureiyā
Any one have how to connect Mongodb to django connection
Do you want to use Django with MongoDB? Then you shouldn't Please read this article: https://daniel.feldroy.com/when-to-use-mongodb-with-django.html
JairamJavv
Has anyone worked with patch requests using drf?
Doragonsureiyā
Has anyone worked with patch requests using drf?
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
JairamJavv
Is there any suitable example on patch requests with drf?
𝙻
Peace be upon you, how can I make a difference when a person registers in a specific way, such as a doctor who has a method of examination and a merchant who has a method of examination, each one of them has different additions from the other
Sojs
Hello everyone, please help. In the views file, there are 4 changes that I pass to each function, I solved the problem with global changes, but it is wrong and works crookedly, I tried using a class, but django swears at "self" If it helps, I will be very grateful
Anonymous
in one book i saw this view: class ProductListView(ListView): template_name = 'product_list.html' paginate_by = 4 def get_queryset(self): tag = self.kwargs['tag'] self.tag = None if tag != 'all': self.tag = get_object_or_404(models.ProductTag, slug=tag) if self.tag: products = models.Product.objects.filter(tags=self.tag) else: products = models.Product.objects.active() return products.order_by('name') and this url: path('products/<slug:tag>/', ProductListView.as_view(), name='products'), i am getting 404 when i request /products/(
Francesca
Please help 🙏🏻 python - django question I have 2 models: Model A with an attribute ‘importo’ which is a DecimalField Model B Whith a field that is A and is a ForeignKey of model A with related name ‘ascadenza’ Then I have a template with a big table that show model B and model A attributes, I this table I filter with Q quesryset through model B attributes Once I do I quesryset based on model B attributes just few instances are selected and I need the Sum of the attribute ‘importo’ of these instances of the related model A that correspond to my B model queryset filter How can I do this sum aggregation or annotation? The syntax I tryed didn’t allow me access the related model A attribute ‘importo’.. Anyone can help?
Helin
I write tests for the first time, is that enough? https://telegra.ph/quest-06-13-4
Driptamine
Are there any Unofficial Documentations for Django? Like w3schools, MDN
Driptamine
cause above ones are difficult to navigate and lacks some information(asave, acreate, aset)
Driptamine
bruh - asave, acreate, aset
Charly
bruh - asave, acreate, aset
https://docs.djangoproject.com/en/4.2/ref/models/querysets/#django.db.models.query.QuerySet.acreate
Charly
its not different from non async methods, same signature and returns
Sandip
When i created django custom user that time i have declared AUTH_USER_MODEL ='user.CustomUser' but still i got AUTH_USER_MODEL Refers to model 'user.CustomUser' that has not been installed
Sandip
You make migrate?
No im trying to migrate but it shows same error
S
How can I filter records in stackinline , Admin panel
Doragonsureiyā
How can I filter records in stackinline , Admin panel
Read this please: http://catb.org/~esr/faqs/smart-questions.html#intro
.
Is is there anyone who have experience with server side datatables
Ola
I’m new to Django CMS and I’m trying to create a module that will contain a text and add it just below the footer. But here’s the twist, the footer has been rendered as a plugin and is placed as a static placeholder in base.html
Ola
I don’t know how to go about it
Doragonsureiyā
Is is there anyone who have experience with server side datatables
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Пушкарева Алина
Hello everyone! Who can say why Postman can't find page with given url?
Charly
Maybe your code is wring but without any details is impossible to help
ʀᴏᴏᴛ
Hello everyone! Who can say why Postman can't find page with given url?
1. The URL may be incorrect or misspelled. 2. The server hosting the page may be down or experiencing issues. 3. The page may not exist on the server. 4. The page may be behind a firewall or access restrictions that prevent Postman from accessing it. 5. The request method used in Postman may not be supported by the server. 6. The request headers or parameters may be incorrect or missing. 7. There may be network connectivity issues preventing Postman from accessing the URL.
Пушкарева Алина
https://github.com/Linapush/django-hws-7-2_2023/blob/pushkareva/music_collection/collection_app/urls.py Am I specifying the correct path for router.register? Thank you in advance!
مريم خالد
.
did you make migratins first time when you declared AUTH_USER_MODEL if yes , you will probably need to drop all the tables related to the User model
مريم خالد
how it should look?
path("data/", include(router.urls)),
Amit
Hello Sir I want ro add json file to my database I dont know please help me
Пушкарева Алина
path("data/", include(router.urls)),
Thanks, router.urls was, I did not pay attention. I forgot to add "/" in postman in the end
Amir
https://dpaste.org/J79Jj i wannt to access encoded_query variable for pagination in first time i click on button it show data on template but second time it does not show data give encoded_query = none please help
Shivani
Hello I have one problem I deploy my project on Google cloud platform it's deploy and give a link successfully but when I open link it's show server unavailable
Shivani
Ok
Jose
Hello I have a little problem configure TIME_ZONE in 'Americas/Santiago' but when I create some register the hour no match with Santiago local time , any suggestions?
Siuuuu!!
Hey, I am developing a twitter-like platform in Django but need some here; When I click on a user's username i want to be directed to that user's profile page. The current program I have only directs to the user who is logged in my computer no matter not username I click on. Help me with your suggestions guys. Especially the database query I should make. TIA
The CAPN
can I share my stack overflow question here? I am not getting suitable response to my error there
The CAPN
No, you could ask here your question directly
hi sir, https://hastebin.com/share/apuvowexuk.lua here I am facing trouble deploying django project with gunicorn and ningix on digital ocean. I have already created the droplet and am following the steps as mentioned in their official step by step guide but am stuck with these errors this is my gunicorn.sevice file syntax https://hastebin.com/share/amugeqorim.makefile and upon checking status of the gunicorn i am getting https://hastebin.com/share/nowewapolo.ruby intrestingly though the gunicorn file is present in the directory when checked
Vikash
@bigbossman444 you added files on StackOverflow then please share your question link
Vikash
@Carlangueitor i think djangoprojectenv is virtualenv of this project
The CAPN
So that file exsists?
Yes it does show up when we 'ls' in the very directory
Charly
Yes it does show up when we 'ls' in the very directory
what do you mean by "the very directory"?