Anonymous
Make them lower resolution or higher compressed
how do i do that,any library or guide
George
Well just think logically. What is the range of sizes of your images?
George
Does the user store images on the server?
George
Do you need them to be high resolution?
George
You could compress yourself the images or load them after page load or only when they are shown on the body. Depends on your webpage. What do you need.
George
You could make the browser do the operation, or the server. Depends on the capacity of your devices and the cost.
George
Also check what image quality do you need to store.
Anonymous
ok,thanks
Luis
i get this, i need a solution to compress image before upload
I think using client side operation (JavaScript) will save you server cpu load and site performance should be better. Sorry for my grammar. I speak spanish...
Luis
Hope it helps!
Rajjix
Noo i was reading 📖 🤔
inchidi
hmm me too 😕
Rajjix
but talking about model managers, can’t you just inherit from modelmanager or is there something i’m missing ? That’s not related to api or rest framework no?
Luis
Ok, guys. I decided to create a model manager for a main model in my scheme and create related instances there. And just keep it simple...
Luis
Thanks for your time and help
Anders (izzno / gooood) 🇳🇴
Anders (izznogooood) 🇳🇴: Have any of you guys tried "editors" like pigendo and bootstrap studio? (in relation to Django / flask) what's your experience and can you recommend it to someone less experienced (but basic understanding) with bootstrap / html and css.
Anonymous
#meta
Anonymous
Dear members, When testing Django in jmeter (nginx+gunicorn+django), we got only 150 concurrent users, after that the request fails. Can you give any suggesion to improve the scalability (8 GB RAM , 4 cores, 250 SSD)
Shaked
Someone knows how to make nodejs connect to python and send information between them i saw the python shell library in node but how python take the info
syam
Redis
Luis
Someone knows how to make nodejs connect to python and send information between them i saw the python shell library in node but how python take the info
Try to test each service involved. Ex: Create a static file and test how request Nginx can handdle when you download these file. If Nginx it's not the problem, keep testing all other services.
Luis
Someone knows how to make nodejs connect to python and send information between them i saw the python shell library in node but how python take the info
Here you can read some performance tips about DJango https://medium.com/@hansonkd/performance-problems-in-the-django-orm-1f62b3d04785
Dcruz
gente
Dcruz
tengo este error cuando intento instalar Django 2.0.6
Dcruz
dcruz@genesis:/media/dcruz/98D8C6B1D8C68CC6/Databank/Desarrollo/Python/Django/Django-2.0.6$ python3 setup.py install Traceback (most recent call last): File "setup.py", line 3, in <module> from distutils.sysconfig import get_python_lib ModuleNotFoundError: No module named 'distutils.sysconfig'
Dcruz
oppss, wrong language sorry :S
Dcruz
got that error when trying to install Django 2.0.6
Anonymous
django pagination with boostrap 4 https://github.com/marcoscoder/pagination-django-bootstrap
Luis
Do you have setuptools installed ?
Dcruz
pip3 show setuptools
That was! jajaj.. i fix it already..
Luis
Nice!
Luis
Hi guys! I have a little problem: I wrote a managers.py to declare my customized managers and it imports from models.py Also I have my models.py that imports my custom managers from managers.py This give multimple errors... I think this circular dependency is breaking my code. Should I remove the file managers.py and put my custom managers on models.py ??
Mirco
Put your managers into models
Luis
Thanks @iFlare3G !!
Combot
Shaked Chen (0) has increased reputation of Luis López (1)
Luis
Nice :D
Anonymous
Can someone help me? I can not add instances of a template with ForeignKey
Mirco
Share the code
Anonymous
I have a Post class with author, title etc .... And I have a Comment class, which has a fk_post field, to use the same id of the related Post object. When I try to add a comment related to this post, for example: >>> from blog.models import Post, Comment >>> new_commet = Comment(fk_post=3, comment="text here", author="i") django return this error: ValueError: Cannot assign "3": "Comment.fk_post" must be a "Post" instance.
Anonymous
I did not quite understand what I should do when I see at this error
Anonymous
in the admin panel of Django, I add a comment using those same values
Luis
OK, I got it
Luis
"Comment.fk_post" must be a "Post" instance.
Luis
You are using number 3 as "Comment.fk_post"
Luis
You should use an instance of Post class
Rohan
Not just int
Rohan
Show the ORM query
Luis
@marcoscoder
Rohan
And the model
Anonymous
how to do it?
Anonymous
I'm sending to the pastebin
Rohan
Fk_post must be some foreign key I suppose
Anonymous
models: https://pastebin.com/3NCb1MaW
Luis
@marcoscoder when you define a foreignkey field you should handle these field as an instance of the referenced model (not as int)
Rohan
Something like this post_instance = Post.objects.get(id=3)
Anonymous
>>> post_related = Post.objects.get(pk=4) >>> new_comment = Comment(fk_post=post_related, comment="new comment.....", author="my name")
Anonymous
ohhhhhh
Rohan
Should have pasted the whole models file
Anonymous
I will try to add through a view that I created
Luis
I will try to add through a view that I created
keep in mind you should use an instance of post class and it will work :)
Anonymous
everything is working now, despite having a bit of "gambiarra"
Anonymous
Nice! What is gambiarra?
https://www.urbandictionary.com/define.php?term=Gambiarra
Luis
Hahahahhahaa
Anonymous
basically this. I managed to do what I wanted, but not in the right way
Luis
basically this. I managed to do what I wanted, but not in the right way
But, this is the way DJango handles foreignkey fields. It isn't a "gambiarra".
Vaibhav
Can we use django as a backend while making Mobile App?
Kaushal
Does anyone have good docs to install django on Windows as production