yogesh
(2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")
John
Deploying my project - help me
1. socket is busy. 2. mysql can't connect to socket (socket does bot exist) https://stackoverflow.com/questions/11990708/error-cant-connect-to-local-mysql-server-through-socket-var-run-mysqld-mysq
kuzmich
Has anybody faced with the situation when you have a lot of signals? Any advice to make it clear 'cause they're executed synchronously?
kuzmich
By a lot, I mean around a hundred
Mercy
Hi there! I have a question. How do I restrict the management of posts? (for example, only the administrator and the author of the post can edit and delete a post?) Are there any ready-made solutions or mixins?
yusof
Hey i have a django package and it doesn't have manage.py to run it. Does anyone know how can i debug it or run it?
Charly
Hey i have a django package and it doesn't have manage.py to run it. Does anyone know how can i debug it or run it?
A "django package" can be an app that need to be installed on a django project, you need to be more specific
yusof
A "django package" can be an app that need to be installed on a django project, you need to be more specific
https://github.com/ali-zahedi/az-iranian-bank-gateways This is the package i want to debug
yusof
It has instrucctions
That's for the time you want you use it on another project. I want run itself
Mercy
You can easily do that yourself. In the management view, you should filter posts which the current user created
But another user can type, for example, url post/delete/1 and delete it. I want to get 403, if user is not admin or author of the post
Charly
Build a sample app and install it there
Charly
Assumin the instructions say that, I can't read them
Anonymous
But another user can type, for example, url post/delete/1 and delete it. I want to get 403, if user is not admin or author of the post
In your view, get the user in the context, check if it's the user that created the post, if not then you return appropriate response
Mercy
As I understand it, I'd better write mixin
Suhaib_0.0
What's the reason? Do not download css adjustments in Django
Leonardo
How pass two function parameters in the template?
Leonardo
One parameters ís {{ param1 | function }} and two?
Anonymous
How pass two function parameters in the template?
If you want to use python callables in templates, you have to create custom tags, register them in template library and finally load them in your templates before use
@LSR
I need help in ajax
Doragonsureiyā
I need help in ajax
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, I need to save the users who created a model objects from a form automatically. I have following field in model. created_by=models.ForeignKey(User, on_delete=models.CASCADE) How can I get users from the form?
Anonymous
‎𝙼𝚞𝚑𝚊𝚖𝚖𝚎𝚍 𝙽𝚒𝚑𝚊𝚍
Okay. the method which renders form has login decorator already. After if form.is_valid(): how to assign logined user to created_by model field?
Anonymous
Okay. the method which renders form has login decorator already. After if form.is_valid(): how to assign logined user to created_by model field?
If you are using CreateView, modify the is_valid(self, form) form.instance.created_by = self.request.user
Anonymous
If you are using CreateView, modify the is_valid(self, form) form.instance.created_by = self.request.user
Be sure to return the default implementation by calling the base method
‎𝙼𝚞𝚑𝚊𝚖𝚖𝚎𝚍 𝙽𝚒𝚑𝚊𝚍
Anonymous
No. I'm using FBV
Then pass the POST data to the form and also set the user. Check if it's valid
‎𝙼𝚞𝚑𝚊𝚖𝚖𝚎𝚍 𝙽𝚒𝚑𝚊𝚍
Let me try :)
‎𝙼𝚞𝚑𝚊𝚖𝚖𝚎𝚍 𝙽𝚒𝚑𝚊𝚍
i'm getting self not defined error
‎𝙼𝚞𝚑𝚊𝚖𝚖𝚎𝚍 𝙽𝚒𝚑𝚊𝚍
https://pastebin.com/uEpuRFTR
Azizbek Xushnazarov
i'm getting self not defined error
lol. you know english? the error is literally written in English.
Anonymous
i'm getting self not defined error
Of course as you would expect!
Azizbek Xushnazarov
i'm getting self not defined error
i recommend to learn oop first
Anonymous
https://pastebin.com/uEpuRFTR
Examples of what you are trying to do is there in the Django docs. We can't help you with everything
‎𝙼𝚞𝚑𝚊𝚖𝚖𝚎𝚍 𝙽𝚒𝚑𝚊𝚍
okay
LazyCoder
Hi guys, I want to deploy a docker container to heroku. Any ideas?
Owolabi
Do you have tracking devices sending device locations to your Django app already (Streaming longitude and latitude that is)
Hello guys, please what's the best way to implement good translation in a Django and DRF? Thanks.
Olami
hello guys.... im new to drf.....any grat material that can help me?
Olami
the documentation seems cumbersome to me
Maxim
the documentation seems cumbersome to me
you don't have to read everything find what's required
Павел
Hello everybody! The problem is the following: there is a "User" model added to admin.py (code - http://hastebin.com/ofuhucekiq.py). There is a function that allows you to download data from this model in csv format in the django admin panel. This function does not work quite correctly, the reason: in the "User" model there is a "status" field, which is a foreign key to the "Status" model. And there is such a case when the "status" field in the "User" model can be null. Accordingly, if I try to download a file with data in which "User.status == null", I get an error, because in the above code, in the "download_csv()" function, I try to access the current_status field in the status model through foreign key. Is there any way to avoid this?
Valter
in big projects , often def used or class
Class is the best option as you can have many Def inside, as soon you lear that better, will save you lots off time in future implementation. Check django doc.
Manik
How to send mail to multiple addres in graphApi in python
Harshit
"Field 'roll' doesn't have a default value"
Akash Gupta
how to implement webrtc in Djngo
Akash Gupta
in Django project
Harshit
just read and realize
When i set for handling default it doesn't work
Doragonsureiyā
When i set for handling default it doesn't work
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
Roman
class Service(Model): number = CharField bill = ForeignKey(Bill, related_name="bill_services") price = IntegerField bills = Bill.objects.prefetch_related('bill_services').annotate(service_number_with_max_price=....) Hello. How can I annotate a service number with max price for each Bill?
Roman
.aggregate(max_price=Max('bill_services__price'))
=(. I need Service *number* of related Service with max price. Not the max price among related services(
Roman
so then I can iterate thought bills and get service number with biggest price for each bill
Roman
i can't change order.. i need specific order for my front-end
Roman
solved it on frontend with js :/, i need more js knowledge
Akshay
I am an beginer in python django but am working in a project as backend developer the project is going to be start in one week can anyone here help me during the project. I have no idea what to do little bit tensed because its my first time .can anyone help me .........
Kirill
Hello guys. I'm trying to solve an issue: how to build a file manager with the hierarchy of the folders in Django rest, could someone help with generating an idea, how to do that, please, I can't imagine how to build models and relations between models for that task. I tried to find something similar, but no luck with that. Thanks a lot!
Akshay
Okay
.
Reverse for the given url is not found I am getting this error how to solve
💢💢
Hello all can any one help me with this probelm while running my Django project
💢💢
I cant uploaded the pic to show you the error
Doragonsureiyā
I cant uploaded the pic to show you the error
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://del.dog, https://nekobin.com
💢💢
Traceback (most recent call last): File "manage.py", line 11, in main from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 22, in <module> main() File "manage.py", line 13, in main raise ImportError( ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
💢💢
this error shown when running the project with 'python manage.py runserver
💢💢
i tried every thing
💢💢
installed newer versions and all