DisboardTetta
No, only English is allowed here
Oh, i check rules now, sorry, you right.
𝑵𝒐-𝑩𝒐𝒅𝒚 𝑵𝒐𝒔𝒆
What is your problem? Is it that the query is taking too long to execute?
Yeah, I wait over 10 second to just get all orders by API. I wanna somehow make easier work with model.
𝑵𝒐-𝑩𝒐𝒅𝒚 𝑵𝒐𝒔𝒆
Well, it's problem arch, what about indexes on fields?
I already have, no result. I wanna implement something in order to make model lightweight
Karim
I want advice from u for one who is shifting from mobile (Flutter) to backend track is django is the most popular framework and has a value if i invest my time to learn it i can find jobs with this in Europe?
DisboardTetta
Karim
Or should i look up for another framework
𝑵𝒐-𝑩𝒐𝒅𝒚 𝑵𝒐𝒔𝒆
Show you query, database type and version, explain
database is PostgreSQL 14 and "psycopg2-binary". Python 3.6.8 Django 3.0.7
DisboardTetta
database is PostgreSQL 14 and "psycopg2-binary". Python 3.6.8 Django 3.0.7
I didn't request data on Python) Now, show the request and its explain. You might want to switch to the postgres chat, since query speed is pretty much unaffected by Django.
𝑵𝒐-𝑩𝒐𝒅𝒚 𝑵𝒐𝒔𝒆
did you ask that one ?
DisboardTetta
Cool, but you said that you tried to make the same query via SQL and I am asking for exactly that.
𝑵𝒐-𝑩𝒐𝒅𝒚 𝑵𝒐𝒔𝒆
Cool, but you said that you tried to make the same query via SQL and I am asking for exactly that.
Ohh, sry I deleted these queries after getting not expected results.
DisboardTetta
Ohh, sry I deleted these queries after getting not expected results.
Rebuild on SKL and in the chat on postgres together with the result explain, since it is not django's fault for such a slow query. Offhand, I will assume that you have built the indexes incorrectly, and therefore your queries are executed too slowly.
~
Django jinja has a built-in gettext function like this {{ _("Hello") }}?
Mirco
Django jinja has a built-in gettext function like this {{ _("Hello") }}?
https://docs.djangoproject.com/en/5.2/topics/i18n/translation/#translate-template-tag Django template language has this one for i18n
~
Jinja is not a part of Django
I mean custom django's filter or function
~
Read above 🙂
yean, i know this translate func, but i mean like this {{ _("Hello") }}
Mirco
yean, i know this translate func, but i mean like this {{ _("Hello") }}
No, you have to use translate It achieves the same goal
Ha 💙
Hi How can I determine the cause of the spam call problem?? I don't use OTP or SMS
Charly
Hi How can I determine the cause of the spam call problem?? I don't use OTP or SMS
What are you talking about? How is it related to Django? If you don't give enough context it is hard to help
Ha 💙
Users are receiving annoying calls (from Indian, UK, etc) while using the app I can't determine the cause of this issue
Ha 💙
I can't determine where the penetration takes place. Is it from the front and or back or server?
Charly
But you say they are only getting calls while using the app?
Ha 💙
After 2-3 minutes
Ha 💙
I'm still using db.sqlite3 On nginx server
Charly
like what?
Like putting it in the user profile so people can see it
Charly
After 2-3 minutes
What are you doing with the numbers?
Ha 💙
In the app there is a service called "Contact Seller" that directs the user to WhatsApp chat
Charly
In the app there is a service called "Contact Seller" that directs the user to WhatsApp chat
Lol so that's it you piblished the numbers of the people so anyone can cell them
Ha 💙
Lol so that's it you piblished the numbers of the people so anyone can cell them
But the calls are fake and not real And I haven't uploaded the app to Google Play or Apple Store yet
Ha 💙
I send the application to its owner to test it
Ha 💙
So is not a Django app?
The backend is Django Rest and the frontend is Flutter Mobile
Ha 💙
But not all APIs have authentication
Ha 💙
Because the user can browse without logging in
Charly
Because the user can browse without logging in
So then that's how you expose the phone numbers
Ha 💙
Could this be the reason?
Charly
Could this be the reason?
Even if not, that's a way to do it
Ha 💙
What is the ideal solution?
Charly
What is the ideal solution?
Isn't it obvious? Don't have people's numbers publicly
Ha 💙
But this is the customer's request
🌺
What should i use drf or django-ninja? mainly work is creating apis, need advanced authentication and permissions check. - api key based authentication - per api key based rate limit ( configurable)
🌺
I want to serve my apis as service to customers through paid plan
🌺
Both can be used for that, have you checked their documentation so you can see if you like one more than the other?
Im currently working on drf project for client, but drf is syncronous. Only benefit i see is ninja is asyncronous
Charly
Im currently working on drf project for client, but drf is syncronous. Only benefit i see is ninja is asyncronous
And you need async? Django is not mainly async. I do prefer ninja but it is mostly because it uses type hints. And I'd you have already experience with drf, isn't a better choice?
Charly
Yes, i need async because i will only do scraping based task
What? It is a bad idea to do scrapping in the views
Charly
And if you NEED async then you have your answer
Charly
For async use fastapi
This is a Django group, btw
S
This is a Django group, btw
I know but giving him good advice is also a thing man
No clothes
Hello everyone, I’m working on a government portal project using Django that would centralize various public services for a country (e.g., administrative procedures, social services, tax payments, etc.). The portal needs to be fast, secure, and capable of handling a large-scale user base, with over 1 million potential users. Are there any specific Django libraries, frameworks, or modules recommended for developing such a system? Are there any examples of government portals built with Django? What are the best practices for ensuring performance and scalability (e.g., database management, caching, deployment) for a project of this scale? Thank you in advance for your insights and suggestions!
Shabeeb
I just integrate apple Pay in using strips I add stripe verification certificate in apple Pay developer center and apple certificate added in stripe uploaded and my apple Pay option showing in my payment section but after pay click is processing not any option show just processing show why any idea?
Doragonsureiyā
𝚆𝚘𝚛𝚕𝚍𝚕𝚎𝚜𝚜
Hey guys is there any specific tutorial on how to allow frontend save sessions? I am using drf simple jwt , and i store otp codes in user's sessions , but the frontend can't seem to save those sessions because each request are different from eachother We tried every possible methods and i configured the settings properly for cookies and everything else Is there any guide for this online? Is there anything that can help me understand it's my Django's code problem or front end's? Postman can save sessions perfectly , but the frontend with another laptop can't (connected through WAN)
Jet
Hey guys is there any specific tutorial on how to allow frontend save sessions? I am using drf simple jwt , and i store otp codes in user's sessions , but the frontend can't seem to save those sessions because each request are different from eachother We tried every possible methods and i configured the settings properly for cookies and everything else Is there any guide for this online? Is there anything that can help me understand it's my Django's code problem or front end's? Postman can save sessions perfectly , but the frontend with another laptop can't (connected through WAN)
What's your frontend made in? Secondly, what you are generating is not a session, its a stateless token which frontends from SPAs or Mobile or other systems integrating with your system must present to identify themselves. This is mostly better than sessions which are usually browser and cooker based. Jwt tokens can also be stored in the cookies of your frontend, localstorage, or realm if you're doing mobile too.
𝚆𝚘𝚛𝚕𝚍𝚕𝚎𝚜𝚜
What's your frontend made in? Secondly, what you are generating is not a session, its a stateless token which frontends from SPAs or Mobile or other systems integrating with your system must present to identify themselves. This is mostly better than sessions which are usually browser and cooker based. Jwt tokens can also be stored in the cookies of your frontend, localstorage, or realm if you're doing mobile too.
React And what i meant is i store otp codes in db sessions instead of tables , so when we check whether the otp is correct or not we won't face much issues But each request sent to backend seems to be different from the past one , therefore the sessions won't be saved correctly for that request
𝚆𝚘𝚛𝚕𝚍𝚕𝚎𝚜𝚜
I am abit confused, are we talking about OTPs as in One Time Passwords or JWT tokens. If jwt, why not make them stateless
You see my whole auth system is like this: - After login or register attempts , an otp code will be saved in request's session (user data also get saved in session) - the user would be redirected to otp-confirm endpoint , and if they insert their otp code right , their account would be created if they came from register endpoint OR a jwt token will be generated for them and it gets sent as a Response to frontend However , the otp-confirm view has a custom permission that checks whether the user have a session stored or not. And this is where things get confusing
𝚆𝚘𝚛𝚕𝚍𝚕𝚎𝚜𝚜