Doragonsureiyā
why I cant send media?
Read the rules before any activity: @PythonRules
Mirco
why I cant send media?
if u are so lazy read this one 👇
Mirco
!paste
Doragonsureiyā
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.
Azizbek Xushnazarov
https://dpaste.org/gWno I added custom field to serializer but when i fetch() in javascript. the field is not coming
Mirco
Can someone help me
share also the API View
Azizbek Xushnazarov
share also the API View
https://dpaste.org/O2K5
Azizbek Xushnazarov
share also the API View
https://dpaste.org/4Y0s
coder
unable to "PUT" and update date got error "StringRelatedField.to_internal_value() must be implemented for field . If you do not need to support write operations you probably want to subclass ReadOnlyField instead."
Mirco
https://dpaste.org/O2K5
wait wait remove that line 5 and use SerializerMethodField
Mirco
or better create a property inside the model for that creator_name
Azizbek Xushnazarov
Azizbek Xushnazarov
Azizbek Xushnazarov
Why? It is not wrong i guess.
It is what drf docs says
ЕаsуWау
Has anyone worked with Flask / Django? Something needs to be done, write me
Eng. Mohamed
Hi all, I have some conflict here When integrating Django & vue.js using : 1- django-core-headrs 2- django-webpack-loader What is the difference between them ? Which is better and why ?
ꜱᴇʏᴇᴅ ʜᴀꜱᴀɴ
Hi everyone this is my url: path('blog', ArticleList.as_view()), path('<slug:slug>/', article_detail, name='article_detail') now, I use {% url 'article_detail' %} in my html, but i receive erro. <a class="btn btn-primary" href="{% url 'article_detail' %}">Read More</a> this is error: NoReverseMatch at /blog Reverse for 'article_detail' with no arguments not found. 1 pattern(s) tried: ['(?P<slug>[-a-zA-Z0-9_]+)/$'] could you help me please?
Mirco
Why? It is not wrong i guess.
it's wrong instead
~:$
Hi all, I have some conflict here When integrating Django & vue.js using : 1- django-core-headrs 2- django-webpack-loader What is the difference between them ? Which is better and why ?
Both have different kind of job. Core header used for cross headers that is your django app is running on different IP and your vue.js frontend is running on different IP. For this purpose we use core-headers package. Webpack loader is used with webpack. The main or core function of webpack is to manage your fromdend resources like js css means your static resources. Webpack minify them compress them and uglify the static resources. Hope it will help you.
Fatih
How can i Create style.css my href didnt find
~:$
How can i Create style.css my href didnt find
Simple creat new file. I guess the short key is ctrl+N
dolly
Anyone good in django?
dolly
I need help there is a error in project
dolly
Anyone good in django
5P34R
ask your question if anyone knows they will help you
Anonymous
Anyone good in django
Paste your error.. please
Umar
How can I implement post views in Django model?
Alex
hi there, I need some help, please I have 3 models: class User: ... class Wallet: users = ManyToMany(User, related_name='wallets') class Cover wallet = ForeignKey(Wallet, related_name='covers') How can I rewrite this queries: wallet = user.wallets.filter(...).first() covers_count = Cover.objects.filter(wallet=wallet, ...).count() in one query for DRF queryset? I need to do ordering through covers_count
Alex
https://www.django-rest-framework.org/api-guide/fields/#serializermethodfield
as I know, it's not possible to ordering through SerializerMethodField
Eng. Mohamed
Wallet returning list Covers_count returing number What you are aiming to do
Alex
I have UserView with UserSerailizer in DRF which contains field 'covers_count', I need to implement order ASC/DESC with 'covers_count'
Alex
u need to annotate the covers_count to use it for ordering
I know, but I don't understand how to write this subquery 🤷‍♂️ can you help me?
Mirco
from django.db.models import Count covers_count = Cover.objects.filter(wallet=wallet, ...).annotate(c=Count('id')).order_by('c') based on the code u have shared above
Alex
and how it annotate in UserView?
Mirco
and how it annotate in UserView?
The code I've shared should be used inside the view
Ivan Kalinin
Can celery recieve tasks but don't execute it because of i work on windows?
 ‌‌‌‌Hamed
Hi Why my variable pass in template and dont show any things ?? And wen i inspect didnt show my code source??
𝕯aniel
You can't render data in html?
 ‌‌‌‌Hamed
You can't render data in html?
Yes i cant i send variable and use it in template but didnt show sny
𝕯aniel
So, show me please your views.py file
 ‌‌‌‌Hamed
 ‌‌‌‌Hamed
I cant understand :(
 ‌‌‌‌Hamed
You think is simple like hellow word
𝕯aniel
Send me message
𝕯aniel
To direct
E. Ghislain Makolle
Good evening, I'm new I have read the code of conduct so I hope this message will not be frowned upon 😅 I ran into a problem while following a tutorial on using Django and despite my research I found similar cases but without concrete answers, so I would like to know if anyone could help me here please 🙏🏽
parandhamudu
Check drf tutorial
Share me any tutorial
ADI
i am facing the error model from Exception Value: table Blogapp_blog has no column named user_id (models) class Blog(models.Model): title = models.CharField(max_length=180) content = models.CharField(max_length=800) Categery = models.ForeignKey(Categery,on_delete=models.CASCADE) user = models.ForeignKey(User,on_delete=models.CASCADE) baner_image = models.ImageField() created_at = models.DateField(auto_now_add=True) update_at = models.DateTimeField(auto_now_add=True) i am using blog site project plese solve the error
ADI
S I put it
coder
class ConsumerSerializer(serializers.ModelSerializer): newspaper_of = NewspaperSerializer(many=True) newspaper_of=serializers.StringRelatedField(many=True) # newspaper_of = serializers.ReadOnlyField() class Meta: model = Consumer fields = ['id', 'name', 'ac_no','newspaper_of','address','telephone','email','note','delivary_charge','status'] # depth = 1
Karthick
I want add the User name into new model so I use User.username but I got <django.db.models.query_utils.DeferredAttribute object at 0x0000020D3C456400>
ֆ33ʏ377
can django-celery disable job automatically except for one-off tasks ?
Firdavs
NOT NULL constraint failed how i solve it, please help me
Anonymous
Anonymous
NOT NULL constraint failed how i solve it, please help me
Either u give value to the field or remove not null property
Alberto
Hi, I have some issues daemonizing celery for my Django project, maybe someone can help me fix this: https://stackoverflow.com/questions/68471472/errors-on-celery-daemon-startup
Jai
I had been trying to implement low level caching in a django view, only to realise I can't access it from another view. Is there a way I could set the cache in a view and access it from another? Thanks in advance.
Anonymous
Hello LookupError: No installed app with label 'admin' Any one knows about this error please help me
Anonymous
Work on Channels
Anonymous
I am making a video chat
ֆ33ʏ377
Work on Channels
are u trying to add app in setting.py? installed_app
Anonymous
Already added
Anonymous
INSTALLED_APPS