Shubham
Hello do anyone know how to upgrade django channel
Shubham
?
Shubham
from daphne.server import Server, build_endpoint_description_strings ImportError: cannot import name 'build_endpoint_description_strings'
Shubham
I am getting this
Shubham
https://github.com/django/channels/issues/864
Shubham
this what I refered
Ильяс
How can i add total sum of my paycheck to a clients debt
Ильяс
two different models
Ильяс
and two different apps
Денис
How can i add total sum of my paycheck to a clients debt
sounds unclear. Do you need a ForeignKey to some model in another app?
Ильяс
No
Ильяс
Thanks. i've found out what to do))
Ghorz
I have a model created in Django, simple one. I have updated the value of this model through the web page. Is there anyway to check the previous values of a certain ID?
Hahaha, you have to create a separate model or have a field that you'll copy data to before destroying it. You'll write a logic to do that.
Ghorz
How can i add total sum of my paycheck to a clients debt
Show it mathematically first, the use it to create your logic
Yash
Hi, please suggest a good library for compressing Django upload files of any format
Yatin
Is there a way where i can give a path to a function inside a class in CBV?
cj
Is there a way where i can give a path to a function inside a class in CBV?
if you've notice, you call YourViewClass.as_view() so, as you can see, you're calling the function .as_view() of the CBV, so yes, technically you can, but you're gonna break things if you don't know what you're doing 🤷🏻‍♂️ but, if you're asking that, it means you don't, so the short answer is: "NO"
dhelbegor
Hi guys, someone here use factory boy to populate fake data?, I mean, using factory boy as fixtures
cj
I just tried and did it. Though i do not know if it is an ethical way... What i did is yourviewclass.myfunction
it has nothing to do with ethics but chances are that maybe you're writing unmaintainable code, so your future self (or another developer) will call on your mom 🤷🏻‍♂️
Yatin
😂😂😂 ok dat was a good metaphor... So i will use an alternate way of creating a different function and using FBV
Alejandro
hello... How to change the color of the polygon dynamically in django-leaflet
Hari
How to write a ajax call for django forms (one field)...
Pachy
How to write a ajax call for django forms (one field)...
https://simpleisbetterthancomplex.com/tutorial/2016/08/29/how-to-work-with-ajax-request-with-django.html
Mr. Achiever
Has anyone tried using otp for Django admin? I was able to add otp feature. But the models that should be visible in admin don't show if otp is enabled.
Almaz
Hello everyone! I've an issue. Django, postgres and nginx are in docker. DB data is lost on each restart containers. I set up the volumes. As I noticed this problem appeared, after nginx set up to project.
Ильяс
How to get all purchases of the client?
Ильяс
https://repl.it/repls/DarkgreenGreenyellowServers
Ibrahim
Has anyone done google authentication to get access token? I have done the gmail authentication but I don't know how to get the access token.
Ravid
Can I combine DirectAdmin with Django?
Ravid
or another panel?
Shubham
https://github.com/shubham1507/Food-app
Shubham
https://dpaste.de/gg3G
Shubham
can anyone take a look at this error
Shubham
?
Kapil
Can anyone tell me how to deal with 503 error ?
Bunty chhatri wala..
can anyone take a look at this error
Check your models file again..
Jesus
Hahaha, you have to create a separate model or have a field that you'll copy data to before destroying it. You'll write a logic to do that.
Oh I see, so once I do an update of a field, the previous value will be destroyed by default right? Dang it, I lost something important 😆 Anyway, thank you for the idea of how to keep backup this field!
Yash
I have two models. Students has name, class. Parents has name, one-to-one relation with Student. How do I access query set of students who's parent name= 'somename' ?
Andrey
Students.objects.filter(parents__name='somename')
Андрей
Hi, I want to ExtractDay from annotated field
Андрей
.annotate( expire_days=F('expiration_date') - now))\ .values( days=ExtractDay(F('expire_days'))
Андрей
But it doesn't work
Андрей
How I should do it?
Андрей
Annotation of expire_days works perfectly and add new field
Yash
Students.objects.filter(parents__name='somename')
I haven't added any parent relation in Student model Relation between them is in Parents model i.e one-to-one(Student)
Yash
So I was trying to get students query set from Parent's set
Andrey
So I was trying to get students query set from Parent's set
What is related_name value of one-to-one field in Parents?
Andrey
It should be name of Parent model in Student model. For example. If related_name is 'parent' then it will work like Students.objects.filter(parent__name='somename')
Yash
It should be name of Parent model in Student model. For example. If related_name is 'parent' then it will work like Students.objects.filter(parent__name='somename')
Ya but this won't be using the advantage of relation between them. Since name of parent is in parents table I want to get it using relation
Andrey
It's 'student'
is 'student' the name of field in Parent or the related_name value of student field in Parent?
Yash
is 'student' the name of field in Parent or the related_name value of student field in Parent?
It is a field in the Parent. student = models.OneToOneField(StudentInfo,primary_key=True, on_delete=models.CASCADE)
Mohsin
Guys, can we create a telegram channel or slack channel with a curriculum for be a either back-end dev or full stack guy
Mohsin
@admin
Andrey
It is a field in the Parent. student = models.OneToOneField(StudentInfo,primary_key=True, on_delete=models.CASCADE)
student = models.OneToOneField(StudentInfo,primary_key=True, on_delete=models.CASCADE, related_name='parent')
Yash
student = models.OneToOneField(StudentInfo,primary_key=True, on_delete=models.CASCADE, related_name='parent')
Did these changes to my model and tried Students.objects.filter(parent__fName='somename') since my name field in parent is 'fName' but got error— Related Field got invalid lookup
Kavin
Can anyone give me resources for learning Django in pdfs
Doragonsureiyā
Can anyone give me resources for learning Django in pdfs
Check out PythonRes, a channel for Python resources (links to help you out).
Master
Can anyone give me resources for learning Django in pdfs
https://media.readthedocs.org/pdf/django/3.0.x/django.pdf
Evgeniy
Hi, i need to get request "/api/v1/gps/?speed_from=0&speed_to=13&altitude_from=0&altitude_to=13" with not required params, how can i make correct path on urls ???
Андрей
.annotate(expire_days=ExpressionWrapper(F('expiration_date') - now, output_field=DurationField()))\ .values( 'id', days=ExtractDay('expire_days'), titlte=F('number'), date=F('expiration_date'), ) That works, if you want to get day, year or another things from annotated timedelta
Evgeniy
https://docs.python.org/3/library/urllib.parse.html
i meant url in django like path('gps/?<int:speed_from>/',...)
Master
path('gps/') if this is a GET request, I guess. Try to be more specific. What are you want to achive?
Evgeniy
ok, i'll try
Evgeniy
thanks
Anonymous
I want to encrypt data to database after save and decrypt to the authenticated user due to privacy...I find django-encrypted-model-field but it's not properly configured..what can I do?
Master
Use any other crypto-apps for django or configure django-encrypted-model correctly.
Anonymous
Use any other crypto-apps for django or configure django-encrypted-model correctly.
I am generating key in cmd but it's showing improperly configured FIELD_ENCRYPTION_KEY but I need to Generate it first then I can set it
Master
»> There is a Django management command generate_encryption_key provided with the encrypted_model_fields library. Use this command to generate a new encryption key to set as settings.FIELD_ENCRYPTION_KEY.
Anonymous
FIELD_ENCRYTION_KEY defined incorrectly: Fernet key must be 32 url-safe base64-encoded bytes.