Ronald
whats your RAM situation? Django is usually chilled with Ram but just asking
Pavel
32 GB for the system, each worker gets about 100M
Ronald
yeah that shouldn't be a problem. I've got a 1gb vps and runs about 5 django sites
Pavel
Well, I can show the sources, but not sure it is easily to read them and guess the problem
Pavel
And again, on dev it's pretty fast (as it can get with so much inclusions)
Ronald
32 GB for the system, each worker gets about 100M
is it possible to give the workers a bit more RAM
Ronald
just to be sure
Ronald
?
Pavel
I'm not limiting them, just stating how much they use
Ronald
ah okay
Ronald
yeah then its not the prob
Pavel
I got rid of threads and it's a bit faster now (10 processes with no threads have a 2s avg request time and 10 processes with 4 threads each had about 30s)
Pavel
Sometimes it's really fast like right now, and sometimes it suddenly becomes very slow without any reason
Pavel
Very confusing
Rammanoj
I implemented OTP verification in django, I used a random OTP generator, it's working good. But a doubt stuck to my mind. If the random generator generates same otp to two different users. How to validate the OTP ??
Rammanoj
simply send the phone number in your verification process
ohh fine, but most sites does not do that right ? They just ask for the verification code. How do they handle their requests?
inchidi
ohh fine, but most sites does not do that right ? They just ask for the verification code. How do they handle their requests?
actally most of them do that, its just user didnt input their phone number again, but front end temp store it and add to request data on background
Rammanoj
actally most of them do that, its just user didnt input their phone number again, but front end temp store it and add to request data on background
but if the user, does not verify at the time of registration and tried verifying some time later, then he/she has to enter the number again right ?
Rammanoj
inchidi
so will there be no option provided in that case ?
its up to you, you can also store their phone number in localstorage and if exists, redirect user to verification page
Rammanoj
ohh cool thanks
cj
but if the user, does not verify at the time of registration and tried verifying some time later, then he/she has to enter the number again right ?
you should associate your user with the way of verifying using the OTP, so you can have it active for a defined time
George
How can you handle an http request so that when people access your ip they get redirected to port 8000?
cj
you have to set a redirect policy on the web server
Anonymous
Hi why doesn’t Django use decorators for routing like Flask?
Anonymous
django uses urls.py file
I want to know why does it use urls.py when decorators are more understandable. I’m not defending flask. It’s just a question that I like to know its answer.
cj
you can read more here: https://docs.djangoproject.com/en/2.1/topics/http/urls/
Mirco
I want to know why does it use urls.py when decorators are more understandable. I’m not defending flask. It’s just a question that I like to know its answer.
They could be understandable, but if you think about bigger and more organized projects, a file where a developer can find all urls related to a specific app is much better
Anonymous
Hi everyone!
Anonymous
I have one quick question, does anyone know how to pass tuple as kwarg to url endpoint? :)
cj
I have one quick question, does anyone know how to pass tuple as kwarg to url endpoint? :)
kwargs stands for "keyword arguments", a tuple doesn't have keys 🤷🏻‍♂️
Anonymous
well if I would do something like
Anonymous
kwargs = {"mutli_uuid": (uuid, uuid2) }
cj
you should "convert" your tuple to a dict (somehow) first
Anonymous
That has a key :D
Anonymous
I need that because I'm working with unknown number of objects
Anonymous
That need to get submitted to same URL
cj
show your url
Anonymous
video/upload-multiple/(?P<multi_uuid>[0-9A-Za-z_\-]+)$",
Anonymous
I know this regex is extra
Anonymous
And not correct
cj
well... start making a correct URL then
Anonymous
But wihout the regex it still doesn't work
cj
also, if you're gonna upload something, you shouldn't pass values as URL arguments, that's why the request body exist
Anonymous
Well url is passed to user via sms
Anonymous
I need to determine somehow connection between certain objects and that video
Anonymous
am I right in presuming I don't need jQuery when implementing Django?
Anonymous
@OrangePartisan Nope, you can use jQuery on frontend tho
George
Also django is just at the back, jquery is not related to Django
George
Seemed superfluous to me
Nowadays its not necessary
Anonymous
Then it's out, ty
cj
I need to determine somehow connection between certain objects and that video
🤔 maybe you need to improve the architecture of your app 🤔
Anonymous
@c0x6A Haha i know! But I'm just working on the stuff someone other started and trying to pull the best from it :D
cj
@c0x6A Haha i know! But I'm just working on the stuff someone other started and trying to pull the best from it :D
well... step one, delete all the not working stuff; step two, write working stuff 😄
Anonymous
well... step one, delete all the not working stuff; step two, write working stuff 😄
Easier said then done when you have one more day to push new features lol
Anonymous
I guess this ain't possible so I'll try to figure out something else :D
Anonymous
Fixed the stupid regex..
Mirco
Fixed the stupid regex..
If your url is simple and you're using Django 2.x, u can use path() More readable imho
Anonymous
Yeah it's 1.11 Django :(
Anonymous
I usually do use newest releases
Mirco
Oh ok 👍👍👍👍
Perumal
How to connect the mysql and python django
icute
class QrcodePermissionCreateView(AdminUserRequiredMixin, CreateView): template_name = 'perms/qrcode_permission_create_update.html' success_url = reverse_lazy('perms:qrcode-permission-user') form_class = QrcodePermissionForm model = Oauth def get_context_data(self, **kwargs): context = { 'app': '权限管理', 'action': '创建扫码授权', } kwargs.update(context) return super().get_context_data(**kwargs)
icute
BootstrapError at /perms/qrcode-permission/create/ Parameter "field" should contain a valid Django BoundField. Request Method: GET Request URL: http://localhost:8080/perms/qrcode-permission/create/ Django Version: 2.1 Exception Type: BootstrapError Exception Value: Parameter "field" should contain a valid Django BoundField. Exception Location: /opt/jumpserver/lib/python3.6/site-packages/bootstrap3/renderers.py in init, line 248 Python Executable: /opt/jumpserver/bin/python Python Version: 3.6.6
icute
😭 how to resolved it ?
icute
hello , can someone please point for me what i'm doing wrong?
Ooha
Can we use cv2 inside html??????
Ajay
Guys how to perform searching
Ajay
In django