Hello everyone, as someone who has just started working on the project, I'm currently only using the core modules. I'm gradually discovering the libraries offered by the ecosystem. While learning Django, which types of libraries/plugins would be healthier to use? For example, what are the popular approaches in areas like authentication and REST API? What do you recommend?
What is the best practice when working on a Django project?
👁️ 7 views💬 1 replies❤️ 0 likes
1 Replies
At first, the topic of authentication felt like a nightmare to me too. I mean, right after setting up the backend, I'd think, "Why did I rewrite this from scratch?" In my early projects, I started using Django's default `django.contrib.auth`, but is it really a scalable solution? Then I realized that in most projects, handling auth with `django-allauth` or `django-oauth-toolkit` is much faster. For example, if you want Google/GitHub login for an e-commerce site—not just email/password—`allauth` is a lifesaver.
When it came to the REST API part, at first, while tinkering with Django REST Framework (DRF), it felt like I was trying to do everything manually. Then I noticed that DRF’s offerings like `ModelSerializer`, `DefaultPermission`, and `ViewSets` actually save you from writing tons of boilerplate code. Especially as projects grow, automating OpenAPI documentation with `DRF-spectacular` makes things easier. In the end, these libraries exist for a reason—it’s better to adopt them early than to regret later, "Why didn’t I know about this?"