Hi. Thanks for the great video. Can you suggest where to look for effective tutorial on how to setup Django to run on Could SQL? Or make a video yourself about this?
I'm new to programming and using generators with database in case the data comes one day to be large. my question is isn't it always good to go with does the performance matter as big YES like why we even need to consider another approach?
if u are working with large data its a thread/process pool excuter with a map if its not parlalizble then save it to memory/push to db inside a for loop if its something like an np array or pytorch tensor try and use the package build in operations the rest is allways comprehention except if u r working with non python people
I honestly don't think there's ever a scenario where the cumulative effect of the savings through list comprehensions outweighs the costs of code that is harder to maintain. Dev time is usually more expensive than CPU time and code that is harder to read can significantly increase dev time. You would have to have quite a lot of these loops in your code or really really large arrays to go through to make this effect be noticeable. But that in itself is a code smell and shows that you probably need to use different tools to solve your problem like just using numpy.square(array), which is probably 20 times faster than all of the alternatives.
Haha, fair point! Absolutely, it's all about context. While list comprehension in Python can offer great readability and convenience, performance considerations may lead some to explore languages like C++. It's a trade-off between ease of development and raw speed. Although if you go with python you wouldn't want your code freezing unexpectedly!
@Beyond Datbase. I don't understand that you still put the database in a docker container in the production compose file. Because you say it by yourself that it is not wise to put a database in a docker container in production. So we can omit the database container in production?
Thanks so much for your explanations. However, I would like to see you make video on how to connect the containerised django app with a locally running instance of postgres database.
please do a video where u code about -Time on site -Pages per visit. -Bounce rate -Returning visitors for admin analytics reports i am new to django and this things are advance
That's not what he said. He said that Docker added a layer of complexity and in production it might be better to use RDS for Postgresql. He seems to be implying that Django and Gunicorn should run in Docker but Nginx and Postgresql should not.
Thanks. But how could I implemet DocumentViewSet with frontend input. I can't realize... because don't see where is out indicating id or name as q or something else as GET.get('q'). COuld you help?