I'm transitioning from a Spring Boot project to a Django-based setup, and I have limited experience with Python and Django. I'm looking for some guidance on how to properly refactor my existing project into Django, which will be version 2 of what I'm currently working on. Any tips or considerations would be greatly appreciated!
4 Answers
Since you're new to Python and Django, I recommend gaining some hands-on experience with Python through smaller projects before diving into Django. "Django 5 by Example" is a fantastic resource that guides you through real projects step-by-step. Once you're comfortable, you'll be in a better position to tackle your refactor. Good luck!
Honestly, I'd advise against it! Django can be quite cumbersome and might not deliver what you're looking for. Just sharing my experience here—sometimes sticking with what works is the best option.
Keep in mind, refactoring in Django differs significantly from Spring principles. Forget about concepts like SOLID, and instead focus on the Django ORM, which follows an Active Record pattern. Moreover, dependency injection isn’t present like it is in Spring, and be prepared for a different approach, especially if you're creating APIs—consider using Django REST Framework or Django Ninja for that.
Doing a complete rewrite like this can be risky; it’s more of a rewiring than a refactor. Consider why you really need to switch technologies. It might be worth assessing the driving factors behind this decision before making any moves.
That's a solid point, but I think understanding the reasoning behind switching tech stacks is crucial too. What challenges have come up that led to this decision?