Summary

This chapter was more about exploration than new concepts. The only major new concept that you learned was about the inner workings of Django forms, and this section took up fewer than five pages. The rest of the chapter was about finding solutions to problems that we encountered along the way.

As I said at the start of this chapter, this was the most complicated application that we have created in the book. It is also likely to be one of the more complicated applications you will create at the start of your career. It is by no means a polished product; that's more because we didn't do any frontend work, rather than some lack of features in the Django backend.

While the knowledge we gained about Django forms in this chapter will prove invaluable to you, I would like the main takeaway from it to be the approach to solving problems. We found a problem we needed to solve, we experimented in the Django shell, and we found a solution. Sometimes it's a bit more complicated than that. You probably need to search the Internet for existing solutions or ask your colleagues. However, after finding answers that seem to be relevant to your problem, you will always have to go back to the experimentation and make sure that the solution really does solve your problem.

The way I showed you how to play around in the Django shell is just one of the many ways that you can choose to experiment with different solutions. As I've mentioned before, everyone has their own technique. Some use management commands, some use simple Python scripts, and some write test code in the views. In the end, you will come up with a way that you like the best.

Another thing that I hope you take away from this chapter is the use of external libraries to help solve our problems. When we needed a way to store JSON in our database, we used the jsonfield library that was available as open source instead of rolling our own custom solution. This has benefits and drawbacks. The benefits are that if you find a package, such as jsonfield that is widely used, you will get a solution that has been tested by many before you. Due to that testing, the library will be much more stable than what you, or any person, can come up with on your own. The drawback of using something external is that you have no control over the direction the project takes and in some projects, you'll have to painstakingly go over the code for the external library to make sure that it meets any regulations your project might have about external code usage.

However, personally, I prefer to use a tried and tested third-party library every time over creating something by myself. For me, the pros usually outweigh the cons.

That's it! This was the final chapter in this epic journey that we started with a simple blog! We have come a long way from where we started; however, I'm sure that your journey as a Django web developer is just starting. You have many more exciting things to look forward to, and I wish you the best of luck in this journey. I hope you enjoyed reading this book as much as I enjoyed writing it. Bon voyage!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.159.82