LinuxBugs
i use the django orm I did not understand the second part of your explanation
There is certain setting in any database which allows number of max open connections. Probably the configuration of your database is less, which is limiting Django to open a connection and query results
LinuxBugs
can anyone help?
food = 'bread' vars()[food] = 123 print bread # --> 123
LinuxBugs
food = 'bread' vars()[food] = 123 print bread # --> 123
This should give you an idea of how to use a string name as variable. Use it for your objects.
noob
Oky i will google wait
M
i have different button on website when i click on a button i pass it name in dictantiory and from that dict i wanna get name of objects
Save objects with the key of name in dictionary and pass that with context . With click of button get the object directly by key
M
So it will work .. u said u getting name of object which is different that getting object itself
LinuxBugs
I increased it and the problem was fixed But my question is, is this the right way or not?
This is the right way. This is the task of DBA. Generally I use postgres. We have around 5000 connections open default. If you're handling a heavy loaded website, then proper attention on database access by your webservers is essential
LinuxBugs
More the open connections, more the load on DB. It all depends on your use case.
LinuxBugs
On the contrary, if you're not having a loaded website, then there is some problem in your Django ORM , it's not closing the connections. Try to update your Django version and check.
Hamidreza
On the contrary, if you're not having a loaded website, then there is some problem in your Django ORM , it's not closing the connections. Try to update your Django version and check.
I am using the latest version My program generally uses multiple Telegram accounts Logs them in Registers Uses them and ... Number of accounts, for example, 2000 accounts I increased the Max Connection number on one server and it worked But on a server, when I increased it for no reason, even when the website is not component, 10 GB of server RAM is occupied.
LinuxBugs
I am using the latest version My program generally uses multiple Telegram accounts Logs them in Registers Uses them and ... Number of accounts, for example, 2000 accounts I increased the Max Connection number on one server and it worked But on a server, when I increased it for no reason, even when the website is not component, 10 GB of server RAM is occupied.
Yes. You see database is also a software. Each open connection thread of database uses resources. So it is generally not ideal to run database and webserver on the same compute instance. More over, the resource requirement for each thread of database exponentially increases because of DB load.
LinuxBugs
The perfect ideal way is to calculate the most possible number of dB connections you'd need by rate limiting your users and use thst configuration in your DB. In production you must be having multiple DB nodes, in sync, if you're dealing with good amount of queries
bikrant
Is it ok to use tokens in shared preference?
bikrant
Or is there any other way?
bikrant
JWT
Can u explain
LinuxBugs
Can u explain
Look at JSON Web Tokens on YouTube/Google
bikrant
I'm using django token authentication and using api to get data in flutter application .
Mirco
I'm using django token authentication and using api to get data in flutter application .
that's ok, it's not mandatory to use JWT the best one currently and imho is 0Auth2 with PKCE to give more security and fill the gap of JWT
Mirco
Oauth works in complement to django token?
It's different and you need to build also the provider etc etc otherwise you should use something external but it depends on the price etc etc So it depends on what u r building
Doragonsureiyā
Ok thanks I'll read about it
You're welcome! 😊
Dev
How to retrieve data from api using django please give me some example of codes ?
noob
model1 = apps.get_model('PJ', context ['system']) print("hi" +model1)
noob
this is not pritining anything
M!L∆D
Hey guys! I have this project, it's a school management system. I want build page that teacher comes and selects his/her class (and also can only his/her classes not other teachers') and writes the message and clicks on the button and it opens up a "bootstrap modal". In there, he/she chooses whichever students he/she wants and clicks on the button sends them the message. Now I can't get students to show to the teacher. Can you help me? Here's my models, veiws and template.
M!L∆D
I can't send any images
M!L∆D
The group is restricted 😑😑
M!L∆D
What should I do?
M!L∆D
Send my codes?
Doragonsureiyā
What should I do?
Read the rules before any activity: @PythonRules
cj
I can't send any images
why do you want to send images? did you read the rules?
cj
No, I didn't. I should.
yes, you should read them
M!L∆D
yes, you should read them
Thank you 😊🙏🏻
McLean
@require_login How do i use this function ,help??
cj
@require_login How do i use this function ,help??
that function doesn't even exist... also you should use Google first
mukul
@require_login How do i use this function ,help??
I thik you are saying If user is authenticated
cj
I thik you are saying If user is authenticated
he's talking about @login_required ... but that can be easily found in Google
Dev
@require_login How do i use this function ,help??
If u want to use this function you just need to put it above view where you want to need require login
McLean
that function doesn't even exist... also you should use Google first
@c0x6A help on that , i want my blog to first ask for an authentication before getting on the dashboard page , what would i do in the views.py share a short code snippet
Yuvi
How to fetch image
Anonymous
Please do anyone know how I can restrict staff from accessing superuser details even if they have the permission to add and change users in the admin site
Slava
You can manage user roles in admin panel quite easy.
Anonymous
You can manage user roles in admin panel quite easy.
If I give staff permission to add/change user, he will have the access to alter the superuser even be able to change it's password which is disastrous
Akinsola
I know this is a long shot, but, does anyone know how to integrate Django rest framework with angular universal to perform server side rendering, the tutorials I see are for node alone so I don't know how to even start with django
David
Friends have done an SSO with django? It is advisable?
goku
how can I fetch list of names from database in alphabetical order?
Hjk
Dpes temporaryuploadedfile work properly for ffmpeg ???
Hjk
Ffmpeg .gif error
noob
model1 = apps.get_model('PJ', context ['system']) print(model1)
noob
Its not printing anything
Shubham
Hello fellas, I was asking, if I implement a system developed in django in a LAN, Will the password recovery process still work without internet?
I doubt that. Image if you locked inside a room will you be able to contact outside world? No right, so same with this.
Viswa
UnboundLocalError at / local variable 'stud' referenced before assignment
Viswa
UnboundLocalError ,,, what can i do for this error
Harsh
you must have use 'stud' variable before declare it
Viswa
yeah i use that
noob
This is working: <img src='/Media/{{i.Netflix_image}}' class="card-img" alt="..."> I wanna do this : <img src='/Media/{{i.{{name}}_image}}' class="card-img" alt="...">
Harsh
yeah i use that
you have to declare that variable first
noob
{{i.{{name}}_image}} what actually you wanna do?
In name it have "Netflix" so i wanna do is i.Netflix_image
noob
So i wanna do is{ i.name}
LinuxBugs
@noob_007 pose your questions correctly. Use code sharing tools to share your code. I tried to help you in your previous issue, it took me a lot of time to understand what you're trying to do. If you want solutions, first search Google, then ask with code sharing tools.