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
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 ??
inchidi
inchidi
Rammanoj
Rammanoj
ohh cool thanks
cj
George
How can you handle an http request so that when people access your ip they get redirected to port 8000?
Ghorz
cj
cj
you have to set a redirect policy on the web server
George
Anonymous
Hi
why doesn’t Django use decorators for routing like Flask?
cj
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
cj
you can read more here: https://docs.djangoproject.com/en/2.1/topics/http/urls/
Anonymous
Hi everyone!
Anonymous
I have one quick question, does anyone know how to pass tuple as kwarg to url endpoint? :)
cj
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
cj
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?
George
Anonymous
@OrangePartisan Nope, you can use jQuery on frontend tho
George
Also django is just at the back, jquery is not related to Django
Anonymous
Anonymous
Then it's out, ty
cj
cj
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
Anonymous
Anonymous
I guess this ain't possible so I'll try to figure out something else :D
Anonymous
Fixed the stupid regex..
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