Mirco
@pyflare correct me if am wrong?
It does not mean anything If the API returns a JSON you can use response.json() to convert it in python dictionary
Devo
It does not mean anything If the API returns a JSON you can use response.json() to convert it in python dictionary
True correct , if you are sure that it returns only json response.. happy to use response.json()
Python
Give an example of it
@devi @mirco I have a postman collection api that generated for giving hash address beloge the wallet I have to use this address with post method and save them into the database for any users
Mirco
@devi @mirco I have a postman collection api that generated for giving hash address beloge the wallet I have to use this address with post method and save them into the database for any users
Ok so as I said initially make the request inside the view, parse the response and save the hash into a model That's it You can use requests or httpx for making the request to the API like you do in Postman Obviously you need to have a model related to a User
Mirco
Ok, tanx Isn't necessary to write middleware or set domain in server???
No, you just have to make an API call like you do with postman You don't have to setup anything
Mirco
Doragonsureiyā
Than you
You're welcome! 😊
Brandon
Has anybody worked with Graphql and Django?
Anonymous
The API root only displays endpoints which are in router register but not from urlpatterns
ui can add a nav bar or drop down list to navigate between pages
Doragonsureiyā
Has anybody worked with Graphql and Django?
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
TWB
NOT NULL constraint failed: store_customer.phone
TWB
class Customer(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) phone = models.CharField(max_length=15) email = models.EmailField() password = models.CharField(max_length=500) def register(self): self.save()
TWB
can anyone help
Doragonsureiyā
can anyone help
Maybe anyone is here, yes, but they are not obliged to read everyone's message here neither to reply to everyone's message, if someone wants to reply to your message, they will do that, just don't try to draw attention to your message writing "anyone?" every 5 minutes, that will lead you to be warned for SPAM/Flood, just be patient or use Google/DuckDuckGo to research about your question instead of wasting time here waiting for people to do your work. Have a nice day 😊
Doragonsureiyā
class Customer(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) phone = models.CharField(max_length=15) email = models.EmailField() password = models.CharField(max_length=500) def register(self): self.save()
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
Naushad
/
Zack
anyone has any idea in integrating TOTP using django in web application
Mohamad
Hey guys I have model called product which has a many to many field on self I'm having trouble doing serialization for crud operations (The tricky part which I'm stuck with right now is the edit operation i have some how handled other parts but i appreciate a full explanation on all of the operations)
Bwaks
Hello am trying to use django forms but my date is not woking like normal html date this-----> <input type ="date"> instead its comes like this------> <input type="text"> this is my code..event_date=forms.DateField(widget=forms.DateInput(attrs={'type': 'date'}))
Bwaks
I would want my dango form to generate this html -----> <input type="datetime-local" >
Michael
My django project loads properly on chrome but when I open with Microsoft edge my styles don't show up Any idea what's wrong ??
Daniel
why?
Morteza
why?
remove str it has should be search.replace
Morteza
thanks bro
you're welcome!
Anonymous
Hello I am using login required and its working but when i logged in its not redirecting me to the click page and even when i manually go towards the concern page it agains require login even after login... Please help
Anonymous
Can anyone please help I dont know is the problem behind this
R
Anyone know about your key is exposed on github I got this
ꜱᴇʏᴇᴅ ʜᴀꜱᴀɴ
Hi everyone How can I create a search engine for an online store with Django? Please provide me with some sources Thanks
Shivendra
Can someone help me for this how to save a csv or xlsx file in database and how to create a api
Anatolie
help me create user model using abstractbaseuser and baseusermanager
laurel
help me create user model using abstractbaseuser and baseusermanager
The Model which you want to make abstract, keep abstract = True, under meta class. Than inherit that model.
Anatolie
The Model which you want to make abstract, keep abstract = True, under meta class. Than inherit that model.
I need exactly a custom model with the email,first name,last name and status fields
laurel
I need exactly a custom model with the email,first name,last name and status fields
You can define these feilds in abstract model Model class
Anatolie
but the best option is with abstract and manager
laurel
May be
Peaches
Is there django rest framework expert who can help me?
Peaches
I want to request.data in DELETE method APIVIEW
Charanpreet Singh
Hey, I developed a backend using Django rest framework but I do not know frontend, could someone suggest the best ways to get the frontend part done the easiest way!? PS : I am aware of bootstrap.
Charanpreet Singh
Thanks for helping, could you please share some resources or some examples of 'htmx' being used with django.
Charanpreet Singh
That's great, thanks!
U
Hey everyone. I need your help. In my project: front - react, back django. When i fetch api with react project everything is alright, but when i'm building react and then try to fetch with django back i'm getting cors preflight error. Can you help guys?
Charanpreet Singh
Hey, is it not rendering a html inside the views.py file in this example ? In the api I built it is just returning data in form of Json. Could you provide some more insights on this @pyflare
U
i'm fetching data not from my server
U
i already add corsheaders
U
but nothing can help me
Charanpreet Singh
Okk, I will have a look at it
Mirco
you have all the stuff inside request.user
Mirco
inside the view u can access request.user
Mirco
so for example Task.objects.filter(user=request.user)
Mirco
tasks
Mirco
I don't have the magic ball 😊
Mirco
My strong suggestion is that u have to study more
Mirco
so if u share code and errors we can help u otherwise have a nice day
Mirco
the issue is inside your query
Mirco
you don't have the Task model related to User model
Mirco
how do you thing you can relate the Task to a User ?
Mirco
study how Django models work
Wang
how do you thing you can relate the Task to a User ?
One User can have many tasks . One task was belonged one person. It’s many to one relationship. Use foreign key
Tsogi
Hey guys! Does it make sense to have multiple admin panels for each application in a Django project?
Tsogi
Is it even possible?
Wang
For admin or employee
Tsogi
You mean to have 1 for (super)admin and 1 for employee, right? Isn't it easier just to have 1 and manage user permissions?
RKumar
[02/07, 6:24 PM] RK: Sir maine debug = False kiya or project ko pythonanywhere pe live kiya sara page work perfectly but one page give server error (500) [02/07, 6:24 PM] RK: How to solve it
RKumar
How to solve it
RKumar
Chekc your url.py
I am using handelar_400
Uday
Hi can any one help me to create my app in Django