Илья
Hello! I have a list of products in the category and my pagination is working. When in the template I use tours.count - it gives me a total product number of that page. How can I count all products from all pages.
Check your pagination class. It must have a get_paginated_response method. In it you have access to a list of data. From there you can take the total. If the class is default, then inherit and override the method
Илья
do you mean if I am using paginate_by in ListView class, I should inherit and override?
For some reason I thought that you were through the DRF Try something like this. def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['total_results'] = self.object_list.count() return context override get_context_data, access to your queryset inside and set qs total into context
Илья
do you mean if I am using paginate_by in ListView class, I should inherit and override?
or try this {{ page.paginator.count }} I think this is what you are looking for
Suren
or try this {{ page.paginator.count }} I think this is what you are looking for
thanks but somehow this doesn't return anything - I had {{ tours.count }} which showed me only 5 results and I tried {{ tours.paginator.count }} which is not returning, maybe I am doing some mistake?
Suren
try page_obj.paginator.count
Thank you so much, this worked
Obaida Aljarjary
Hey guys
Obaida Aljarjary
I'm new to rest framework Is it normal if I am confused at the beginning ?
Dlight
can anyone who has been used render.com to host its Djago application on there? My images in the project has not being diplayed in there
For every provider there is always a change in setting for hosting statics . See if u implement it
Jiya
Hello can anyone help with django please
Jiya
Have to add payment method
Doragonsureiyā
Hello can anyone help with django please
No one can help you until you explain your difficulties.
مريم خالد
i am trying to override password change in dj_rest_auth , so that instead of sending link by the email , it takes an email amd return id , and using the id it changethe user password ,the problem is i keep getting this error TypeError at /user_api/password/change/3 Field 'id' expected a number but got <CustomUser: string>. this my serializer :http://linkode.org/#sponfjTqefW9CZsvKQM6k5 and this my view :http://linkode.org/#ZTCfSKG5CdIwVP8Q2kljV6
Mr Perfect
Did you override the ResetPasswordSerializer as well from dj_rest_auth??
مريم خالد
no just the change
Mr Perfect
can you explain more ?
Actually for resetting password, this uses a form by default in dj_rest_auth.. so that part can be overridden where we send reset email as well.
Ramon Braga
Good afternoon, could someone point me to a good admin template to run on django with features?
Ramon Braga
dashboard template
Ruslan
Good day! Could anyone share the experience of connecting SmartPay API (1.02) (Sberbank) to django?
Anonymous
Hello, I need someone to help me paypal integration in django project Pls contact me. Thanks
Mohamed Elsaleh
Hey hello everyone how can I make a reservation system
Charly
Hey hello everyone how can I make a reservation system
Start by designing it, use cases, actions and features in general. Then you can think on traslading these to django
Mohamed Elsaleh
No I have all these things but there are some problems my code but I don't know where is it
Mohamed Elsaleh
i don't have the acces to aploade any thing to this group thats why
Jiya
Can anyone help me razorpay integration in django project
Anonymous
Yes
can you help me?
Charly
can you help me?
Explain yourissue here
Charly
Can anyone help me razorpay integration in django project
Explain whathave you tried and where are you stuck?
Charly
Can you msg me privately
No, help is provided here
Anonymous
Actually, in websites like Upwork and Freelancer, after add paypal payment method, Once subscribe new plan, we don't need to input credential again.
Anonymous
I hope this functionality
Anonymous
I want to know if there is customer id or not in paypal
Anonymous
If yes, I can create subscription plan using that customer id?
Jairaj
Hello, I need someone to help me paypal integration in django project Pls contact me. Thanks
Hello I can help I have done PayPal integration into django successfully
Django
Hello everyone I have Ubuntu vps hosting So, i deleted by mistake media file with rm -rf command But still have database in image path How to restore media root folder ?
Doragonsureiyā
Hello everyone I have Ubuntu vps hosting So, i deleted by mistake media file with rm -rf command But still have database in image path How to restore media root folder ?
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Charly
I talk about django media file
No you are latking of a normal file you delted on your machine
Django
No
Django
I have django media_root folder
Django
Postgres in have also image path
Django
How to restore like collectstatic
Charly
I have django media_root folder
Still these are normal files if you deleted it it has nothing to do with django
Django
Okay
Charly
How to restore like collectstatic
You can' t with django if you deleted file you fucked up
Freddy
what are the best tutorial to build a complete ecommerce web application
Doragonsureiyā
what are the best tutorial to build a complete ecommerce web application
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
M
I have a table in Django and now I want to connect to Database SQLite, how?
Doragonsureiyā
I have a table in Django and now I want to connect to Database SQLite, how?
To get an answer to your question, it is worth to formulate it more clearly, perhaps add more details, perhaps add explanations.
Vijay
Bro, you should use def keyword instead of class. The reason is that if you want to use a function in Python, you have to use the def keyword, which is mandatory in ,Bro.
Yes bro it was a mistake actually I didn't realise I was class creating a class. When I realised so I corrected this mistake
Charly
I have a table in Django and now I want to connect to Database SQLite, how?
Did you checked the official django tutorial? As you seem to ignore the most basic setup you' llprobably need to start there
Stack
👋 I have a lyrics project with Django, I have already done a large part of it, I want to put the favorites functionality with Django restframework and JavaScript api fetch but unfortunately I always fail. can anyone have an idea how to do it?? help me please
Obaida Aljarjary
Can I send you the course that I am studying and tell me what are the things that I should study that are not in it?
Charly
Can I send you the course that I am studying and tell me what are the things that I should study that are not in it?
That doesn't make too much sense, finish the course, then start making projects if there is something you can' t do l;earn it
Obaida Aljarjary
That doesn't make too much sense, finish the course, then start making projects if there is something you can' t do l;earn it
I did finish the course and i made projects But i am asking what else should i study to improve my back-end skills
Charly
Try the book two scoops of django
Obaida Aljarjary
Ashot
Hey out there! I'm facing this kind of a problem, I have a login registration application on django, every time I refresh while the auth user is logged in, it shows that CSRF verification has been failed. Is there anything I can do to fix this?
Marco
Hello ommunity, is anyone has to used the auth of django based on datra-able of appseed already, im suffering with it, maybe some exemple please please please
SoibovR
Hi everyone! I'm trying to restore the database but I'm getting an error, any help will be greatly appreciated ls ~/ rid.dump rid.sql pg_restore -U rid_user -C -d rid ~/rid.dump pg_restore: [archiver (db)] connection to database "rid" failed: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "rid_user" pg_restore -U postgres -C -d rid ~/rid.dump pg_restore: [archiver (db)] connection to database "rid" failed: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "postgres" pg_restore -U postgres -C -d rid ~/rid.sql pg_restore: [archiver] input file appears to be a text format dump. Please use psql.
Patrick
Any Idea, why I'm getting cors error on netlify react while calling DRF api. Django is on ec2 no ssl no domain. *installed corsheaders*
Lena
django.db.migrations.exceptions.InconsistentMigrationHistory
Lena
how to solve it?
Lena
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration main_app.0026_alter_bootcamp_end_date is applied before its dependency main_app.0025_merge_20230621_0901 on database 'default'.
ERMIA
Added hosts? And allowed?
Inluced in instaled app and added the middleware?
Patrick
everything is alright
Patrick
I added self ssl to ip
Patrick
now its working for Android website and windows
Patrick
not on Apple 🥹