Roman
Oops
Roman
Sorry
Roman
https://pastebin.com/C2rQ9hzR
Roman
If any could have a look please , just no info about anywhere
Thomas
Hi everyone. Can someone help me with models and have an experiences with DjangoCMS? I have problem with copy_relations() method and M2M field which is not copied. It is maybe trivial problem but I cannot figure it out.
Thomas
https://dpaste.org/TaEE#L
Thomas
When I publish page Im calling FormDefinition and FormField is there. But element_classes and field_classes are NONE and I dont know why.
Thomas
I already asked in DjangoCMS group but without success. We didnt find where is problem.
Aman
https://pastebin.com/raw/tTW9z1R4
Aman
I Want json response in API in curly braces but it will come in list https://pastebin.com/raw/tTW9z1R4
Khalil Ibnu Omar
Hi everyone, I am beginner in Django And I need help to build crub api
Loki
@Amanmodis try using json library
Xavier
I Want json response in API in curly braces but it will come in list https://pastebin.com/raw/tTW9z1R4
i guess u cant api json response will give u in an enclosed package [{},{}]
Loki
Yes but can it be iterated?
Xavier
where u process the fetched api? if using js then it wont be an problem
Xavier
Loki
Ohk thnks👍 @Chair_dad
Loki
Whenever i use request.FILES it gives me wrong path can u help me @Chair_dad
Loki
Path should be media/media/ but instead it returns media/
Aman
i guess u cant api json response will give u in an enclosed package [{},{}]
{ "tid": "22784", "data": [ { "id": 4, "item_name": "test1", "price": "500.00", "item_photo": "/media/documents/profileimage/IMG-20191028-WA0008_sNCwzOh.jpg", "description": "test report", "unit_id": 2 }, { "id": 5, "item_name": "chaha", "price": "562365.00", "item_photo": "/media/documents/profileimage/1200px-LetterD.svg.png", "description": "kdjkfjdkf", "unit_id": 55 } ], "statusCode": 0, "txnTime": "12 May 2020, 06:04 PM", "statusMsg": "SUCCESS " }
Gil
Your json isn't valid, one object or one list ( with objects). https://jsonlint.com/ https://www.json.org/json-en.html https://stackoverflow.com/questions/35019030/how-to-return-custom-json-in-django-rest-framework https://docs.djangoproject.com/en/dev/topics/serialization/#serialization-formats-json Maybe you need to change frontend
Rsk
Guys.. how to do audio file saving in model thru api using drf ?? File along with some other data ? Please give some suggestions
ps
How to replace value when new value is added from backend? Anyone
ps
Ya update
raven
Guys.. how to do audio file saving in model thru api using drf ?? File along with some other data ? Please give some suggestions
use Filefield and limit file extension to mp3 so that you only accept audio file. Use multipart form when uploading from frontend . Rest DRF will handle .
raven
Ya update
there are many ways to do so maybe you should look at the docs once. You can do it yourself with functional view or with ClassBasedView .
ps
I want to know just that keyword
ps
There muat be a specific keyword
raven
https://www.google.com/amp/s/www.geeksforgeeks.org/django-orm-inserting-updating-deleting-data/amp/ this link will help you
devops
Can anyone help me in reading mail from Gmail using api key in dango
devops
Django
Doragonsureiyā
Can anyone help me in reading mail from Gmail using api key in dango
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box write down the same words you asked here Step 4: Read the firsts results
devops
I want code
devops
In python
devops
For reading email in inbox using api key
cj
I want code
then write it yourself
Roman
Guys I have a question to the rest framework if anyone knows , I have a serializer and I have some additional fields in the serializer , so the problem is that when I create I pop some fields and then when I try seriazlier.data I got the error that like attribute does not exist in the model
shekhar
can we make something like this webpage wants to access your google fit data?(i want my webpage should display this after taking my display page)
Rsk
Also api views which drf providing is for json
Rsk
Not form data
Rsk
This is my understanding..
Rsk
Is there any way we can still use drf serializers and api views . For handling file ??
Roman
Guys my server just stops working without any message what can be the reason ?
Roman
It's empty
Aman
How to create post API to fetch data from MySQL server
Jo
hello someone could help me please
cj
How to create post API to fetch data from MySQL server
why do you want to fetch data using POST? 🤔
Jo
def article(request, news_pk): news = get_object_or_404(Presse, id=news_pk) return render(request, 'article/article1.html', {'news': news,})
Jo
path('<int:news_pk>', views.article, name='news'),
cj
For security reason
that doesn't make sense
cj
what kind of security?
Jo
h4 class="uk-margin-top"><a href="{% url 'news' news.id %}">{{motivation.titre}}</a></h4>
Aman
that doesn't make sense
I think post is encrypted and get are not
cj
I think post is encrypted and get are not
you thought wrong 🤷🏻‍♂️
Jo
get error "no reverse with argument"
Jo
don't know where the issues is
cj
Is it possible or not
again... why do you want to fecth data using POST?
Jo
path('<int:news_pk>', views.article, name='news'),
Jo
this is my urls.py
Jo
and everything look correct
ᴹᵃᵏˢᵃᵗ
How to create post API to fetch data from MySQL server
Google says: To do a POST request we need to specify additional parameters with the request such as method, headers, etc.
ᴹᵃᵏˢᵃᵗ
Aman
I try but not find any usefull
Aman
google it
Tell me the keywords
Aman
To search