yogesh
(2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")
yogesh
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
John
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?
yusof
Charly
Anonymous
yusof
It has instrucctions
That's for the time you want you use it on another project.
I want run itself
Charly
Charly
Build a sample app and install it there
Charly
Assumin the instructions say that, I can't read them
yusof
Mercy
As I understand it, I'd better write mixin
Mercy
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?
@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
Anonymous
𝙼𝚞𝚑𝚊𝚖𝚖𝚎𝚍 𝙽𝚒𝚑𝚊𝚍
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
Anonymous
Azizbek Xushnazarov
𝙼𝚞𝚑𝚊𝚖𝚖𝚎𝚍 𝙽𝚒𝚑𝚊𝚍
okay
LazyCoder
Hi guys, I want to deploy a docker container to heroku. Any ideas?
Maxim
Owolabi
Olami
hello guys.... im new to drf.....any grat material that can help me?
Olami
the documentation seems cumbersome to me
Павел
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?
Anonymous
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?
For every object in the queryset passed to your action, check if the status is None. If it is None, continue, else do your normal logic
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
Maxim
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?
William
Roman
so then I can iterate thought bills and get service number with biggest price for each bill
William
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
💢💢
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
lucifer
💢💢
i tried every thing
💢💢
installed newer versions and all