Вин Король Саксов
mohamad
hello everyone, i have database and i made models in django , and i want to edit data from the tables and delete some data too but by using postman (post،put)and form jason only ,can anyone help me by writing the founction for delete and another founction to modify in views.py by using queries?
Fedora
Hello how do i host a website on google drive
Alexandro
Alexandro
there are many free services to host static pages easily, github web pages for example
William
Fedora
Oooh i didnt know i can use github so how can i use github
Fedora
To host a web page
mohamad
William
William
https://youtu.be/TmsD8QExZ84
William
yes
You can follow the above tutorial for creating API for delete and update function
mohamad
ok Thank you
4candels support
Hello everyone, I have a model with the student’s information and this model is connected to a registration form in the html interfaces. What I want is when the student registers for his information, including the email, I want him to receive a message on his welcome email, is there any help or research method that helps me
Shubham
Guys i am lillte bit confuse about django restframe work and rest Api what is the difference bet then.
Pls help me.thank u
Shubham
Now clear with the help of django rest frame work u can build the rest api
4candels support
.
Can we use Django for backend and firebase for chat together?
Mohamad.m
hi every body
my project error CORS Error
how can I fix it?
and i use the all headers and alll setting but in does not work
.
Не выходи из комнаты.
Hi. Help me, pls
https://stackoverflow.com/questions/69181590/django-channels-page-not-found
Ted
Good
Hi could someone help me use two models and display them on one page
Hunde
I am new to django,I have button in html file when button clicked i want to iterate variable in function found in view.py ,how i can do that?
Anurag
Sanjarbek
#help
when i use this code certbot —nginx i get this error
https://dpaste.org/zaFp
Azizbek Xushnazarov
Cancel saving model when using post_save?
Doragonsureiyā
Cancel saving model when using post_save?
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
Azizbek Xushnazarov
huh, this is not meta. I have explained my issue in one simple sentence.
kuzmich
if what_you_need:
model.field = data
model.save()
kuzmich
try to overwrite save method then
kuzmich
and it's post_save btw meaning it's already been created/updated
Azizbek Xushnazarov
kuzmich
you can try pre_save and raise db validation error then
kuzmich
but I'd go with the save method
Azizbek Xushnazarov
kuzmich
try to do transaction inside save method
kuzmich
it's gonna be saved only when the transaction succeeds
Anonymous
i am facing problem with runserver command
JanelleOfficial
who can code me a FUD crypter
Mirco
Azizbek Xushnazarov
You have not explained anything
[In reply to kuzmich]
You did not get it.
when I save a model it sends signal to my receiver.
In the receiver function if some condition happen it should cancel the saving.
kuzmich
in short... you got two options
1) use pre_save and raise an error
2) use transaction in save method and rollback changes
Kenechi
kuzmich
idk man... you saved the record and deleted it
kuzmich
up to you 🙂
Azizbek Xushnazarov
idk man... you saved the record and deleted it
The reason i am using post_save is because when I do this:
user = User.objects.create_user(username=_username, email=_email)
i can get the email of the user by instance.email and send generated link to it.
But if I use pre_save. I cant get the email of user cause it is not recorded yet.
Sorry I am a beginner. Is this a good idea to do the job?
Alex
Azizbek Xushnazarov
Ted
Thanks I managed to fix it
Anonymous
Hello. I am searching for a Python&Django developer. How can I post a job ad?
Alex
Azizbek Xushnazarov
Suhaib_0.0
Hey
I want to do an experimental electronic market using Django.
I have a question.
How can I make a variable through which I can lower all prices
Mr.
Hi guys.
My django app worked ok on developement settings. now I'm getting it to the production.
I configured nginx and I got a free ssl using certbot.
Now when I enter the address of the admin panel, it works ok, but for my own views it returns nothing!
what would be the problem?
Ismail
William
Mr.
Returns nothing means no data?
excuse me, no. In the firefox i get:
Content Encoding Error
An error occurred during a connection to <MY DOMAIN>.
Please contact the website owners to inform them of this problem.
Ismail
Mr.
Did you set you collectstatic?
thank you very much. it was my problem.
I was returning a simple httpresponse and I didn't think that I need to collectstatic.
Ismail
Mr.
Олександр
Hello everyone, I really need help in this matter https://stackoverflow.com/questions/69178211/how-do-i-run-multiple-sites-on-the-same-server-using-docker-and-nginx?noredirect=1, who can tell?
Anonymous
how would you write a serializer in drf to validate raw json body but the body is only a list, instead of an object
For example a request body like the following
[
"foo",
"bar"
]
Сергей
Hello, there is server nodejs with socket io, can I send on this server messages from django code, for example from model post save?
Poppu
Guys anyone know how we should convert Django model object in nested json without class or DRF
I tried to find out but all the example I see to build API or class based and there are some examples but they also show only single level json
I need to build a function so I can pass my custom model object and get the nested JSON.
Mirco
Valter
Hello everyone, I'm struggling to find a solution on how to send a message for a dealer on my app as I wish to create a communication in between two people only as one send a message and the other can answer it, any advice are welcome. Thank you.
𝓶𝓸𝓱𝓪𝓶𝓶𝓪𝓭
Hello everybody,
I have a question.
If the user in django signup sent a post and the post in not valid (based on django signup laws (for exmple password must not be just numeric and ...))
What should I do to give an error for not is valid post?🌹
Mirco
Poppu
https://imgur.com/a/l82p1Qk
And one more thing why this error occurred whenever I can this function most specific this line of code
I tried to convert my firebase timestamp in Django readable DateTime object this is the only solution which I found on stack overflow and it's work but also give some warning