Anonymous
Hi everyone, please im having a headache over an error how can u define a onetoone relationship from your models in views.py
Rushabh
It will send your current time but make sure in your settings.py file time zone is correct..
Rushabh
LANGUAGE_CODE = 'en-us' TIME_ZONE = 'Asia/Kolkata' USE_I18N = True USE_L10N = True USE_TZ = True
Random
how to include multiple models for single form
Random
?
.
how to include multiple models for single form
Just take inputs for both the model and process it in the view for both the models
Michael the wolf 🐺
Hi, I have some doubt in djangorestframework-simplejwt. I have a requirement that in my user table there will be duplicate username and duplicate emails..but there are some other fields, which makes the user unique. I want to create a token for that particular filter combination. How shall I achieve it ?
Sumit
Hi, I wants to implement a model in a way that if someone has deleted any data than it won''t be shown to him, but will present in the database. I want to do this using graphql.
Sumit
How can I do this?
Nice
Hi anyone here
Nice
I have a doubt on Django polls app which is on Django website I'm getting errors
Nice
Can anyone help me tests.py file
Nishant
Can anyone tell me inittakes 1 positional argument but 2 were given ?
Enigma
Can anyone tell me inittakes 1 positional argument but 2 were given ?
find the line of the code that it makes this error
Zey
I am getting this error :
Zey
ValueError at /vendor/ Cannot assign "1": "Product.seller" must be a "SellerRegister" instance.
Zey
this is my code:
Zey
https://dpaste.org/TBP8
Enigma
Also send register seller model
Zey
15
Enigma
15
Try: Seller_id=seller.id
Enigma
or if the Seller will call Vendor function(i mean the seller is logged in) and create s , its better to use seller_id=request.user.id
Enigma
https://stackoverflow.com/questions/34775501/how-could-i-check-the-number-of-active-sqlalchemy-connections-in-a-pool-at-any-g
WhiteKing007
Hey can we create django project in d or e disk
WhiteKing007
Getting error django-admin is not recognized
M
I am getting this error :
Product.objects.create(seller=seller,name=name,category=category,price=price,desc=desc,image=image) pass seller like an object
Enigma
How to pass it like object
What i said dosent work?
Zey
Ok
Anonymous
So fucking stupid questions all you ask
Anonymous
Indeed you stupid assholes should go and kill yourselves instead of asking such stupid questions. Which can be googled or easily understood if you read a book or watch a tutorial properly.
Anonymous
Where r u from?
Does it matter ?
Zey
Well guys sorry for my response this is a django group we should write related to that only
Enigma
Does it matter ?
No , i just want to know which contry has this terrible culture
Anonymous
Enigma
Wow, there are fucking racists also.
I'll rather to be racists but dont trate to you like a human
Arslan
Wrong thinking, if he is russian then all russians are bad?
Enigma
Wrong thinking, if he is russian then all russians are bad?
He is not bad He has no culture... Culture comes from all the people so not all of them but most of them... Sorry for my bad english :\
M
How to pass it like object
Quick solution, I guess u are storing the seller id online request session, so import the seller model anda get the object example, from .models import Seller and do something like sl = Seller.objects.get(pk=request.session['seller']
M
Sorry, I Am writing from my phone cuz I Am outside
V
I have a template which am using to send email for payment purposes and have a redirect link in it. Am generating link by calling a method in model which has link and token for verification. But what i dont know is how can i bring details to the redirect page? Am getting id and token from link.. both are in same model. But the other details i need is in another model.
M
I have a template which am using to send email for payment purposes and have a redirect link in it. Am generating link by calling a method in model which has link and token for verification. But what i dont know is how can i bring details to the redirect page? Am getting id and token from link.. both are in same model. But the other details i need is in another model.
With the token u can get the object and then u will have All the details, I mean When u pass a token on URL /token=123abc... Then u have a endpoint associated to this URL on the view get the token from the request and get All information from the model filterin by token or if is a primary key get the object directly
Mahdi
Hello 👋 A great article to explain the implementation of social login in Django rast framework
Anonymous
Hi is there any way to clear cookies when I close browser ? I am using sessions
Rushabh
In django settings
Anonymous
I tried that but the cookies are not getting deleted
Rushabh
SESSION_COOKIE_EXPIRY = True
Rushabh
Also try this
Anonymous
Ok
Enigma
Also try this
what's the difference between them?
Rushabh
SESSION_COOKIE_EXPIRY = True
It will return which date you want to exipre..I think..
Rushabh
And above To return TRUE OR FALSE
منتظر
How to access localhost from another computer connected to the same network? + can I accesses it form phone or just computer
AK
In Allowed host add your computer ip address Python manage.py runserver ip:port
Yes you can access it from phone which connected on same network
Agent Q
And check your firewall on both devices. Make sure port no is not blocked
M
How to access localhost from another computer connected to the same network? + can I accesses it form phone or just computer
ifconfig or ipconfig on windows, check your ip network ex: 192.168.1.50 and run python manage.py 192.168.1.50:8080 or 80 if you are not using this port, then u can access from any computer or device connected at the same network
Richard
Hello guys! Cant handle a problem with creating a record via REST API. Everytime getting error 'QuerySet' object has no attribute '_meta'. HERE MY CODE: diary = Diary.objects.get(id=diaryID) queryset = diary.diaryrecord_set.all() serializer = RecordSerializer(instance=queryset, data=request.data) if serializer.is_valid(): serializer.save() return Response(serializer.data) Can anyone help?
Richard
Remove that instance=queryset
Ty very much. Until my last breath i will remember your answer
N
Iam new to django where I can sample project so that I could get the most of the basic of django