syntaxError
hlo pls help. how to take average of Timefield values using ORM query
Doragonsureiyā
hlo pls help. how to take average of Timefield values using ORM query
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 first results
Alex
hlo pls help. how to take average of Timefield values using ORM query
https://docs.djangoproject.com/en/3.2/topics/db/aggregation/ https://docs.djangoproject.com/en/3.2/ref/models/querysets/#avg hope you are able to sum two and two
Doragonsureiyā
😂 I already tried that
Try harder until you get what you want! don't give up! 🦾
cj
then read the links I posted
he doesn't know how to read... just read his messages thread ¯\_(ツ)_/¯
syntaxError
then read the links I posted
i read it bro. it wont help me to take the average of timefield values. using avg not working properly in this case
Alex
i read it bro. it wont help me to take the average of timefield values. using avg not working properly in this case
I'm not your bro. And the part "not working properly" says nothing to me. Provide the code snippet, its output and an error message if there is any.
Alex
U r so serious dude , be easy
I do what I do, because I am what I am. If you think you can do better - then do it and help this poor guy, instead of blaming other.
Surin
How to install Django in windows? When I want install Django give me an error
Dreamer_Aba
1. Install anaconda 2. Open anaconda console 3. Use this command--> conda install django
Dreamer_Aba
First install python IDE by adding its path to environment variable. Then use this command --> pip install django, to install the lastest version of Django.
⟨ Simon |
There is zero reaso to install anaconda
Surin
share the error
I can't send photo my access denied
Surin
Can I send to your private?
Doragonsureiyā
I can't send photo my access denied
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://del.dog - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
Alex
I can't send photo my access denied
I doubt that you're getting the error message as some photo on your email or smt.
⟨ Simon |
That's a funny thought
chaygo
Hello guys! I can use SearchFilter in django rest framework. But then I cant display that datas in django template , how can I do it?
Mirco
Hello guys! I can use SearchFilter in django rest framework. But then I cant display that datas in django template , how can I do it?
why not ? you just have to call that endpoint with the search filter and show the response
Alex
I can't send photo my access denied
how the hell you decided to send that photo to me in private? I didn't ask for that.
Mirco
How?
do u know how to use Javascript to make API calls ? if not, start from it or study HTMX
Dreamer_Aba
can we not give bad advice please?
Bro, he may integrate AI module with the web app. You know that currently recommended python editor is Anaconda because we can easily install all python packages easily. From that perspective, I recommended it .
Doragonsureiyā
No , I dont know. Okk thanx a lot!
You're welcome! 😊
⟨ Simon |
You also never specific that you meant anaconda the editor
Harish
Please help on this. https://dpaste.org/U5HE#
Please provide some inputs on this...Been stuck for days on it..
Swamy
How to send friend request and accept django rest API
Swamy
Please help me
Doragonsureiyā
How to send friend request and accept django rest API
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
Alex
I don't know either cry or laugh.
jūdê
Who can I have a conversation with about Machine Learning
Anonymous
class TodoView(viewsets.ModelViewSet): serializer_class = TodoSerializer queryset = Todo.objects.all() what this class Do. Earlier, we used detailview, listview etc but with rest's viewsets, they say this will do all the work, how?
Alex
class TodoView(viewsets.ModelViewSet): serializer_class = TodoSerializer queryset = Todo.objects.all() what this class Do. Earlier, we used detailview, listview etc but with rest's viewsets, they say this will do all the work, how?
You also can inspect the source code of DRF. It makes clear that ViewSets are merely wrappers around multiple generic actions like create, delete, update and so on with a few more benefits https://github.com/encode/django-rest-framework/blob/master/rest_framework/viewsets.py
Alex
So that's why they are called so - view SETS
Hikmet
Hello everyone! I want to change LANGUAGE_CODE in django settings dynamically from other script, lets say middleware.py. I tried to do like that file middlewares.py looks like that from django.conf import settings if settings.DEBUG = True: settings.LANGUAGE_CODE = 'en' else settings.LANGUAGE_CODE = 'ru' print(settings.LANGUAGE_CODE) #it printed 'en', as my Debug variable is True here it shows right, but when I print my settings variable in my view, it shows 'ru', as I have Language_code set to 'ru' by default. It seem like it changes settings value locally, but not globally. How can I fix that?
Mirco
and then u have the entire topic on Django docs
Hikmet
Okay i'll try that, thank you)
پدرام
Django is a framework for back_end or front-end?
پدرام
mainly backend
front_end ?
Mercy
front_end ?
You can render html, css and js or install, for example, Django rest framework and write api. Then you can use js lib like react or vue for frontend and get json from your django server
Pavel
Hi everyone. Could you get me some examples of django-based projects with tests to understand how to write it in django and what to cover
Shivam
Is there anyone who knows how to update manytomany field in Django rest Framework ??
Alex
Is there anyone who knows how to update manytomany field in Django rest Framework ??
here you go https://www.django-rest-framework.org/api-guide/relations/#nested-relationships
Shivam
Alex I saw that 5-6 time but found nothing 🥺
Shivam
Im working on a project, and that project is runs in USA it's food delivery project
Shivam
I'm just searching on google
Shivam
and I found nothing yet
Alex
and I found nothing yet
Then look closer. def create(self, validated_data): tracks_data = validated_data.pop('tracks') album = Album.objects.create(**validated_data) for track_data in tracks_data: Track.objects.create(album=album, **track_data) return album Aspecially on this snippet. VERY closely
Shivam
It's creating objects of a model, but data is already created, like signup is complete, now I have to create cuisines in a customer model
Shivam
Cuisines(models.Model): name slug Customer(models.Model): user = one-to-one cuisines = manytomany (Cuisines) name phone zipcode
Shivam
user, name, phone, zipcode are created in first step, now I need to create an another API for saving cuisines in customer model
Shivam
is there anyone who knows how to do this ??
Sh!V
error could not find a version that satisfies the requirement django
Sh!V
While installing django in virtualenv
Hasan
hi whats the token/verfy url in dj_rest_auth?
cj
error could not find a version that satisfies the requirement django
stop using Python2 then or explain the exact things you're doing
Doragonsureiyā
error could not find a version that satisfies the requirement django
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
Sh!V
After pip install virtulenvwrapper-win pip mkvirtualenv myapp
Sh!V
When i try installing django
Sh!V
Pip install django
Sh!V
I get error