Django and DRF
333 subscribers
98 photos
39 files
161 links
Purpose is sharing, spreading knowledge which is most related to the Django and Django Rest Framework(DRF)

You can find in here my
- Articles
- Projects with source codes
- Videos
and another useful stuffs
Download Telegram
How to scale a website to support millions of users? We will explain this step-by-step.

The diagram below illustrates the evolution of a simplified eCommerce website. It goes from a monolithic design on one single server, to a service-oriented/microservice architecture.

Suppose we have two services: inventory service (handles product descriptions and inventory management) and user service (handles user information, registration, login, etc.).

Step 1 - With the growth of the user base, one single application server cannot handle the traffic anymore. We put the application server and the database server into two separate servers.

Step 2 - The business continues to grow, and a single application server is no longer enough. So we deploy a cluster of application servers.

Step 3 - Now the incoming requests have to be routed to multiple application servers, how can we ensure each application server gets an even load? The load balancer handles this nicely.

To read more link
Hi guys.
Django Image Optimizer 🍏🍋🍊

This package is very useful to optimize image in your django projects and is simple to configure it.
It allows you optimization by images using TinyPNG or Pillow.
You can introduce with it in this link.
👍1🔥1
https://t.me/shukurdev/1055

In django in the one coolest case will might be used this method 🤩🥳
If you are gonna make SearchView for your project you have to search terms in the any of the models in the application and to do this you search objects by term and you had returned all of object types as separately untill now. So now with this method you will have chance to return results of the objects which you have searched as single keyword which is mean {"key": "value"}.
👆👆👆have showed example in the above image.

p.s: please write comments 😅
🔥1
Use select_for_update() method in Django when you have problem with concurrency.

Agar sizda bir vaqting uzida bir nechta process ni ishga tushirishda muammo bulayotgan bulsa shu method dan foydalanganingiz maqul chuni bu bir process ni yakunlab bulgunicha usha process ni lock qilib turadi va keyin ikkinchi process ga ruhsat beradi.

Link: https://www.sankalpjonna.com/learn-django/managing-concurrency-in-django-using-select-for-update
👍2🔥2
💡 Django Celery Beat is the best package to store tasks which can done as automatically on database. And you can manage all of saved tasks on Django Admin panel and you can create, edit and delete tasks and how often they should run with Periodic Tasks
🫐Pypi package
🍉Source
👍2😁2
Javascript dasturchisi Python code yozsa qanday bularkin deydiganlar uchun Top🍉 examples 🥳
Va bu code ni review qilayotgan men: 😰🥵🤯🤬
P.S: Qanday tilda kod yozsangiz ham har bir tilni uzini qonun qoidalari asosida yozishga harakat qiling please. Sizdan keyingi keladigan dasturchilarni ham ozgina o'ylang, f***, b** kabi so'zlarni eshitmay desangiz 😎
🤣1
Don't move fast to another stack.⚠️
👍4
Read this story from Lahiru Hewawasam on Medium: Link
2
In some cases django devs have one problem with migrations files, so i think the guy who is first met with this issue is gonna delete all of migrations and data in DB. if he does this in the production he will might lost all real data 😰🥴🥶.
Ok WHAT SHOULD IT DO ???
Django has — fake flag which is written with migrate command together like this: python manage.py migrate —fake
It tells to Django that migrations have already applied and not need to run it(DON'T RUN IT).
Actually it creates a row in django_migrations table but not run in the SQL to change table structure.
In one another case if you have multiple migrations file you can delete all of them and use above flag(argument).
Improving API Performance
More
👍3
🔥 I absolutely recommended reading this article to learn more about object serializing way and you realize that which way is the best to serialize in short time.

https://hakibenita.com/django-rest-framework-slow
Architectures
More