Beka
checkout django-jet
Man, I don't need it.
John
checkout django-jet
Never knew of it but I just checked it out. The django-jet is cool. And their "new jet", jet-bridge, is even cooler. I think I will try it out asap, but I hope hell won't break loose.
Girum
view.py @csrf_exempt def edit_todo(request, todo_id): task = Todo.objects.get(id=todo_id) tasks = { "text": task.text, "id": task.id } return render(request, 'Todo/update.html', context=tasks) @csrf_exempt def update_todo(request, todo_id): obj = Todo.objects.get(id=todo_id) obj.text = request.GET['text'] updated_at = datetime.datetime.now() obj.created_at = updated_at obj.save() tasks = { "alltodos": Todo.objects.all() } return render(request, 'Todo/index.html', context=tasks) update.html {% extends "Todo/base.html" %} {% block content %} <div class="row mt-4"> <div class="col-lg-6 col-lg-offset-3 mt-4"> <form action="/update_todo/{{id}}/" method="post" class="form-inline"> <input type="text" name="content" class="form-control mb-2 mr-sm-2" value={{text}}> <button type="submit" class="btn btn-primary mb-2">Update</button> </form> </div> </div> {% endblock content %} urls.py path('edit_todo/<int:todo_id>/', edit_todo, name="edit_todo"), path('update_todo/<int:todo_id>/', update_todo, name="update_todo"), index.html <div class="float-right"> <form action="edit_todo/{{todo_item.id}}/" method="post"> <button type="submit" class="btn btn-md btn-warning mr-sm-2" >Update</button> </form> </div> hello guys I need help please, I am new to Django and was working on To-do app and I faced this error when trying to update, can you help me please MultiValueDictKeyError at /update_todo/32/ 'text' 👇 "obj.text = request.GET['text']"
Beka
view.py @csrf_exempt def edit_todo(request, todo_id): task = Todo.objects.get(id=todo_id) tasks = { "text": task.text, "id": task.id } return render(request, 'Todo/update.html', context=tasks) @csrf_exempt def update_todo(request, todo_id): obj = Todo.objects.get(id=todo_id) obj.text = request.GET['text'] updated_at = datetime.datetime.now() obj.created_at = updated_at obj.save() tasks = { "alltodos": Todo.objects.all() } return render(request, 'Todo/index.html', context=tasks) update.html {% extends "Todo/base.html" %} {% block content %} <div class="row mt-4"> <div class="col-lg-6 col-lg-offset-3 mt-4"> <form action="/update_todo/{{id}}/" method="post" class="form-inline"> <input type="text" name="content" class="form-control mb-2 mr-sm-2" value={{text}}> <button type="submit" class="btn btn-primary mb-2">Update</button> </form> </div> </div> {% endblock content %} urls.py path('edit_todo/<int:todo_id>/', edit_todo, name="edit_todo"), path('update_todo/<int:todo_id>/', update_todo, name="update_todo"), index.html <div class="float-right"> <form action="edit_todo/{{todo_item.id}}/" method="post"> <button type="submit" class="btn btn-md btn-warning mr-sm-2" >Update</button> </form> </div> hello guys I need help please, I am new to Django and was working on To-do app and I faced this error when trying to update, can you help me please MultiValueDictKeyError at /update_todo/32/ 'text' 👇 "obj.text = request.GET['text']"
What is the difference between "edit" and "update" ?
Mehmet
view.py @csrf_exempt def edit_todo(request, todo_id): task = Todo.objects.get(id=todo_id) tasks = { "text": task.text, "id": task.id } return render(request, 'Todo/update.html', context=tasks) @csrf_exempt def update_todo(request, todo_id): obj = Todo.objects.get(id=todo_id) obj.text = request.GET['text'] updated_at = datetime.datetime.now() obj.created_at = updated_at obj.save() tasks = { "alltodos": Todo.objects.all() } return render(request, 'Todo/index.html', context=tasks) update.html {% extends "Todo/base.html" %} {% block content %} <div class="row mt-4"> <div class="col-lg-6 col-lg-offset-3 mt-4"> <form action="/update_todo/{{id}}/" method="post" class="form-inline"> <input type="text" name="content" class="form-control mb-2 mr-sm-2" value={{text}}> <button type="submit" class="btn btn-primary mb-2">Update</button> </form> </div> </div> {% endblock content %} urls.py path('edit_todo/<int:todo_id>/', edit_todo, name="edit_todo"), path('update_todo/<int:todo_id>/', update_todo, name="update_todo"), index.html <div class="float-right"> <form action="edit_todo/{{todo_item.id}}/" method="post"> <button type="submit" class="btn btn-md btn-warning mr-sm-2" >Update</button> </form> </div> hello guys I need help please, I am new to Django and was working on To-do app and I faced this error when trying to update, can you help me please MultiValueDictKeyError at /update_todo/32/ 'text' 👇 "obj.text = request.GET['text']"
You are trying to get text value from query params despite your form has method="post"
Beka
You need to get from POST method.
Beka
Something like, request.POST.get('text')
Beka
<form action="/update_todo/{{id}}/" method="post" class="form-inline"> this is the best approach <form action="{% url "update_todo" something.pk %}" method="post" class="form-inline">
Beka
{% csrf_token %} add this one too, inside your form.
Beka
view.py @csrf_exempt def edit_todo(request, todo_id): task = Todo.objects.get(id=todo_id) tasks = { "text": task.text, "id": task.id } return render(request, 'Todo/update.html', context=tasks) @csrf_exempt def update_todo(request, todo_id): obj = Todo.objects.get(id=todo_id) obj.text = request.GET['text'] updated_at = datetime.datetime.now() obj.created_at = updated_at obj.save() tasks = { "alltodos": Todo.objects.all() } return render(request, 'Todo/index.html', context=tasks) update.html {% extends "Todo/base.html" %} {% block content %} <div class="row mt-4"> <div class="col-lg-6 col-lg-offset-3 mt-4"> <form action="/update_todo/{{id}}/" method="post" class="form-inline"> <input type="text" name="content" class="form-control mb-2 mr-sm-2" value={{text}}> <button type="submit" class="btn btn-primary mb-2">Update</button> </form> </div> </div> {% endblock content %} urls.py path('edit_todo/<int:todo_id>/', edit_todo, name="edit_todo"), path('update_todo/<int:todo_id>/', update_todo, name="update_todo"), index.html <div class="float-right"> <form action="edit_todo/{{todo_item.id}}/" method="post"> <button type="submit" class="btn btn-md btn-warning mr-sm-2" >Update</button> </form> </div> hello guys I need help please, I am new to Django and was working on To-do app and I faced this error when trying to update, can you help me please MultiValueDictKeyError at /update_todo/32/ 'text' 👇 "obj.text = request.GET['text']"
In your update_todo function, first get the object by id. Use get_object_or_404, and than, if method GET, bla bla bla , if request.method == 'POST': and than bla bla.. so play with POST method.
Anonymous
hello coders, i have a issue with directory creation with django-helpdesk attachments
Anonymous
the path is media/helpdesk/attachments/queue-qid/ticketID/filename.pdf name, the folder ticketID always have 600 permissions
Aleksandr
Hi guys. Are there DjangoCMS experts in this group? A have few questions.
Anonymous
Hi guys. Are there DjangoCMS experts in this group? A have few questions.
Just ask and I am pretty sure that if someone knows, he/she will respond 😀
Ibrahim
if i want to create registration system, is it good to store user data submitted via html form using sql command or i should use django users/ ? any other way pls?
Arian
Hello, someone has an example of how to integrate influxdb to django or another time series database??
Mohit
Hello everyone I want to get started with django, I know python
Mohit
and Machine Learning
Doragonsureiyā
Hello everyone I want to get started with django, I know python
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Anonymous
How can i implement http only cookie authentication with django rest?
Darth✧
No
Darth✧
Write that script in your views
Sai
Can anyone help me how to create user registration form to store data like name, password, registered time, etc. Using django and html pages
cj
Ok, you recommend using django users?
of course, that's why it exists
Sai
google?
U mean
Beka
U mean
He meant, why not to Google for kinda basic things.
Sai
He meant, why not to Google for kinda basic things.
Oh ok but better to communicate with the developers will give more knowledge in google i am not getting perfect output
Doragonsureiyā
Can anyone help me how to create user registration form to store data like name, password, registered time, etc. Using django and html pages
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Zokir
Oh ok but better to communicate with the developers will give more knowledge in google i am not getting perfect output
This group will help you when you write a code and receive an error, and you cannot find the reason, and then the guys who have experience will help. Your question is stupid because there are many answers in Google. And here the guys do not have time to study for someone Your question was correct if you asked: "I want to learn to create a registration, please give me good materials to study. No one needs your laziness.
Beka
Oh ok but better to communicate with the developers will give more knowledge in google i am not getting perfect output
At least try your best. You need to do something and come up with problem and describe it here in detail. Now you are asking, "How to do?". Ask, "How to fix this problem?" Show your work not your wish.
Zokir
I will give u what I follow the procedure in google but what the error I am getting I am going to post in the group them u get an idea on it
drink coffee and start learning now. Read books and start coding like us! I think you will succeed
Beka
Yes, this group is for teaching and helping. But do something and ask.
Anonymous
Hey guys, can you help me how to give a permission to a specific objects in django admin please?
Beka
maybe for specific users?
Beka
Select one user and go to the section "Available user rights". There you can choose any permission you want and at the end click save button. That's all.
Beka
By default, there are CRUD permissions. Feel free to add your own permission, too.
Anonymous
Any one having experience of web scrapping using BeautifulSoup(Python)?
Beka
Select one user and go to the section "Available user rights". There you can choose any permission you want and at the end click save button. That's all.
But job is not done by doing all things in django admin panel. Make sure your code also corresponds to that permissions.
Doragonsureiyā
Any one having experience of web scrapping using BeautifulSoup(Python)?
Please don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello I need help on $z" Just ask about your problem directly! With a very high amount of people here the probability that someone will help is pretty high. Also please read: http://catb.org/~esr/faqs/smart-questions.html
Taku
how is xml used in django?
Taku
for web services?
cj
for web services?
that's another story... you'd better want to use REST instead for web APIs
Taku
Create sample XMLs (request and Response) to a service in your WAD project (Example: The flower store web application exposes a service called 'InventoryList". The clients of flower store, for instance the dating app, can request for all available inventories using the service. The input will have data about 'who is asking' and the output will have the 'list' of available flower arrangements.)
Uday
so i have several models in x app all models have same field except 'category' field Where category field has choices i wanna fetch model where category is equal to y any help with this?
Aneesh
How to avoid initial load of data when I use on_snapshot.django+firebase
Aneesh
Please help
Anonymous
http://dland.in check this site and say your valuable opinion
Anurag
can't adapt type 'InMemoryUploadedFile'
Anurag
i am getting above error while uploading mp4 file to AWS S3 using s2direct
Anurag
what can be cause of this and solution
Anurag
s3 direct*
Dwi
How to show menu list in sidebar based on user group logged in and checkbox from django-admin? For example, if the user who logged in belongs to group "A" and the field "sales" & "marketing" in checkbox is true, it will show menu list of "sales" and "marketing". *the checkbox is registered to django admin, so if someday i want to change the value (ex: false to true), it will also change the menu display in my website Thank you very much, any help will be appreciated
Dwi
My model: Class check(models.Model) User = models.OneToOneField(Group, on_delete= models.CASCADE) Sales = models.BooleanField(default=True) Marketing = models.BooleanField(default=True) Consulting = models.BooleanField(default=True)
Abdul Shakoor
Hi developers, I want to track when user leaves my site, I want to perform some tasks when user leaves
Doragonsureiyā
🚫 ‎dLand [1208286770] is already banned.
Anonymous
okay
Anonymous
Anybody here used linkedin API?
Doragonsureiyā
Anybody here used linkedin API?
Please don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello I need help on $z" Just ask about your problem directly! With a very high amount of people here the probability that someone will help is pretty high. Also please read: http://catb.org/~esr/faqs/smart-questions.html
Ejas
Can anyone share a good doc for using celery for sending emails
Ali
Can someone help me i am trying to add two numbers in django but i’m getting object has no attribute ‘get’
Vitaliy
Why do you access 'get' adding two numbers?
Ali
Share the code via pastebin or similar
How can i share the code if the group doesn’t support photos