Anonymous
I learned django basics working fine with admin. What should be the next step to learn? API or Other?
G4st0n
I think the best idea is to use django as backend
G4st0n
Practice how to make a nice api for a real World project using django
G4st0n
Coding
How to connect django rest framework (backend)with react(front end)?
Anshu
There are so many tutorial for the same https://youtu.be/7AkTv4Sl9S4
Follow this
Jaya
hey how do we ignore migrations while pushing code in git
Jaya
i have used **/migrations/* in gitignore file already
Doomer
how much time u spend to learn Django ?
Doomer
it's interesting for me cause i just started
Дауран
I'm looking for a Python book whether in Russian release or English it doesn't matter , also video material
Maxim
Дауран
Sandip
What is the driver to be used for MySQL with django?
Santhosh
Sandip
mysqlclient
What is to be written in the settings.py file?
Santhosh
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': "DB name",
'USER':"root",
'PASSWORD':"",
'HOST':"",
'PORT':"",
'OPTIONS':{
'init_command':"SET sql_mode='STRICT_TRANS_TABLES'"
}
}
}
Santhosh
And be conscious on the name user and password bcz it will wrong the connection was failed
Anonymous
How make field permission on Django rest framework
Anonymous
Admin can update all but user can update some fields
Santhosh
You can change the permission in admin portal. Check that once again.
Dev
Hello guys i created an search field which filter Post.objects.filter(category__icontains=query) and then i got error invalid lookup icontains how can i fix this
Anonymous
Hy guys , when I deployed my app on heroku then I am getting 403 error even I used csrf token.in local host it is working fine .. can anybody please help me.
.
Hi, has anybody worked with graphene django here? Am having a challenge trying to create a mutation.
So basically I have a class createProduct(graphene.Mutation):
With fields
...
collection = graphene.ID(required=False)
...
Def mutate(self, info, **kwargs):
collection = kwargs.get('collection', None)
product = Product(collection=collection)
product.save()
collection is a mana-to-many field in Product.
My error in graphiql when trying to create a product is "direct assignment to a forward side of a many-to-many set is prohibited. Use collection.set() instead."
Am still a beginner in django and don't know what this error means. Your help will be much appreciated 🙏
Heigler Rocha
Sandip
Dev
Dev
Also there is auther= Foreignkey(User,on_delete=models.CASCADE)
Santhosh
Dev
H.G.
Dev
Heigler Rocha
How to do that please help me
You need to add a dunder before and put the field name, Idk why telegram don't allow me to user dunders, but is like: "category__fieldname__icontains"
Abhishek
I have to build a django app which allow user to create models according to their csv files
I want to create field according to the csv file
Any idea?
Sunken
Hi everyone I have a question
in table for a patient visit a doctor or a nurse I want to have a field sth like want_to_visit_id to know witch doctor or nurse the patient want to set a time to visit
So it should be a relation between patient and doctor also patient and nurse
Is there any way to have one field for both?
Orion
Sunken
Sunken
Orion
Can I set tow foreign keys for one field?
Yes ... Whichever model, e.g Doctor can have a foreign key Patient and Nurse associated with it, be careful to include a related_name ..to avoid future conflicts
Sunken
Sunken
Orion
Dev
Dev
You can check my site https://dev39.pythonanywhere.com , username=david,password=admin
Paul
@Dev_ind_ra looks great, would be nice to click on the card title and to get to the article
Dev
Anonymous
Any django expert or experienced person? I need some help to understand a question
Doragonsureiyā
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 😊
Yusuf
how to export data foreign key field to excel django?
Ghorz
Yusuf
What have you tried
Yeah i want export my db to excel, i want to get attribute from foreign key models.
Ex:
Student:
Id, name
Class: Id, student, name_class
When i export class to excel, i juts get id, id student, and name class.
What i want to get
Id, name of student and and name class
Sorry for my English 🙏
Ghorz
Ghorz
Hodaya
Hi, I need to display server-side output to client side, now it prints to the console and I need to display it to the screen-to the client, can anyone help me?
Orion
Orion
Hodaya
I have this code
context = { 'text': text, }
return render(request, "news/voiceToSign.html", context)
on the views.py and this
<h1>{{ text.name }}</h1>
in the .html and its not working, Can you help me with what i need to do?
where this code -
Cars.object.get(id=id)
need to be?
Orion
This code is an example
Cars.object.get(id=id)
They should be in views.py
In your case it is text,
Try just the text output
<h1>{{ text }} </h1>
anuprash
In django admin how to hide data not field, and only show when searching any data
Hodaya
Orion
Orion
Most welcome
anuprash
It's simple means, like our databse save user information and i want to hide information in admin pannel only when search any user by user name then show all detail particular user
Anonymous
How do I create nested category ?
M Latif
Hi friend s how can slove this problem when i register a record it occurs this error and don't redirect in specific template file
But records save in database
I have two app
one appconcert and another account
I imported appconcert in app account but it don't work
Import reverse
Import appconcert
If request. Method == "post"
form =registerform()
if form. Is_valid():
rest of code
profile. Save()
return HttpResponseRedirect(reverse(
appconcert.Views.Home
))
else:
form = registerform()
Data={
'formdata':form
}
return render(request,'register.html',data)
Please help me
M Latif
Error appconcert.views.Home not in valid method
#
Is there any good tutorials for? to perform pytest in django